/*--------------------------------------------------------------
# HaloDokumenty - Mobile Premium App Style
# Professional mobile-first design like a native app
--------------------------------------------------------------*/

/* ===== Global Mobile Fixes ===== */
@media (max-width: 991.98px) {
    .header-buttons {
        display: none !important;
    }

    .header .btn[data-bs-target="#mobileMenu"] {
        display: flex !important;
    }
}

/* ===== Mobile Menu - App Drawer Style ===== */
.offcanvas {
    max-width: 320px;
}

.offcanvas-body .nav-link {
    padding: 0.875rem 1rem;
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s;
}

.offcanvas-body .nav-link:hover,
.offcanvas-body .nav-link.active {
    background: rgba(93, 87, 244, 0.1);
    color: var(--accent-color);
}

/* ==========================================================================
   LANDING PAGE - PREMIUM MOBILE APP STYLE
   ========================================================================== */

/* ===== Header - Glassmorphism App Bar ===== */
@media (max-width: 767.98px) {
    .header {
        padding: 0.625rem 0;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        background: rgba(255, 255, 255, 0.92);
    }

    .header .logo img {
        height: 30px;
    }

    .header .btn[data-bs-target="#mobileMenu"] i {
        font-size: 1.5rem;
    }
}

/* ===== Hero Section - App-like hero ===== */
@media (max-width: 767.98px) {
    .hero {
        padding: 2.5rem 0 2rem;
        text-align: center;
        background: linear-gradient(180deg, #f8f9ff 0%, #eef0ff 60%, #ffffff 100%);
    }

    .hero::after {
        background-size: 20px 20px;
        opacity: 0.5;
    }

    .company-badge {
        font-size: 0.8125rem;
        padding: 0.5rem 1rem;
        margin-bottom: 1.25rem;
        background: rgba(93, 87, 244, 0.08);
        border: 1px solid rgba(93, 87, 244, 0.12);
    }

    .hero h1 {
        font-size: 2rem !important;
        line-height: 1.15;
        margin-bottom: 1rem;
        letter-spacing: -0.02em;
    }

    .hero p {
        font-size: 0.9375rem;
        line-height: 1.6;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 1.5rem;
        max-width: 340px;
        color: var(--text-secondary);
    }

    .hero-badges {
        justify-content: center;
        gap: 0.375rem;
        margin-bottom: 1.75rem;
    }

    .badge-item {
        font-size: 0.8125rem;
        background: rgba(255, 255, 255, 0.8);
        padding: 0.375rem 0.75rem;
        border-radius: 100px;
        border: 1px solid rgba(0, 0, 0, 0.04);
    }

    .badge-item i {
        font-size: 0.875rem;
    }

    .cta-wrapper {
        justify-content: center;
        gap: 0.75rem;
        flex-direction: column;
    }

    .cta-wrapper .btn {
        width: 100%;
        border-radius: 14px;
        font-size: 1rem;
        font-weight: 600;
        padding: 1rem 1.5rem;
        letter-spacing: 0.01em;
    }

    .cta-wrapper .btn-primary {
        box-shadow: 0 8px 24px rgba(93, 87, 244, 0.3);
    }

    .cta-wrapper .btn-outline {
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(8px);
    }

    /* ===== Stats Grid - Compact 2x2 ===== */
    .feature-boxes {
        margin-top: 2rem;
    }

    .feature-boxes .row {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 0.75rem;
    }

    .feature-boxes .col-lg-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .feature-box {
        padding: 1rem;
        border-radius: 16px;
        flex-direction: column;
        text-align: center;
        gap: 0;
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(8px);
        border: 1px solid rgba(0, 0, 0, 0.04);
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    }

    .feature-box .feature-icon {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
        border-radius: 12px;
        margin-bottom: 0.625rem;
    }

    .feature-box .feature-content {
        margin-left: 0 !important;
    }

    .feature-box .feature-title {
        font-size: 1.25rem;
        font-weight: 800;
        margin-bottom: 0.125rem;
    }

    .feature-box .feature-text {
        font-size: 0.75rem;
        line-height: 1.3;
    }
}

/* ===== Sections - Tighter Mobile Spacing ===== */
@media (max-width: 767.98px) {
    .section {
        padding: 3rem 0;
    }

    .section-title {
        margin-bottom: 2rem;
    }

    .section-title .description-title {
        font-size: 0.75rem;
        padding: 0.3rem 0.875rem;
        margin-bottom: 0.75rem;
    }

    .section-title h2 {
        font-size: 1.625rem;
        letter-spacing: -0.02em;
        line-height: 1.2;
    }

    .section-title p {
        font-size: 0.9375rem;
        line-height: 1.5;
    }
}

/* ===== Features - App Card Style ===== */
@media (max-width: 767.98px) {
    .services {
        background: #ffffff;
    }

    .services .row {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 0.75rem;
    }

    .services .col-lg-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .service-item {
        padding: 1.25rem;
        border-radius: 16px;
        border: 1px solid rgba(0, 0, 0, 0.06);
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
        text-align: center;
    }

    .service-item::before {
        height: 3px;
        border-radius: 16px 16px 0 0;
    }

    .service-icon {
        width: 48px;
        height: 48px;
        font-size: 1.375rem;
        border-radius: 14px;
        margin-bottom: 0.875rem;
        margin-left: auto;
        margin-right: auto;
    }

    .service-content h3 {
        font-size: 0.9375rem;
        font-weight: 700;
        margin-bottom: 0.5rem;
        line-height: 1.3;
    }

    .service-content p {
        font-size: 0.8125rem;
        line-height: 1.5;
        margin-bottom: 0.75rem;
        color: var(--text-muted);
    }

    .service-link {
        font-size: 0.8125rem;
    }
}

/* ===== How It Works - Vertical Timeline ===== */
@media (max-width: 767.98px) {
    #how-it-works {
        background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
    }

    .step-card {
        padding: 1.25rem 1rem;
        text-align: center;
        position: relative;
    }

    .step-number {
        width: 52px;
        height: 52px;
        margin-bottom: 1rem;
        box-shadow: 0 6px 20px rgba(93, 87, 244, 0.25);
    }

    .step-number span {
        font-size: 1.375rem;
    }

    .step-card h4 {
        font-size: 1.0625rem;
        margin-bottom: 0.5rem;
    }

    .step-card p {
        font-size: 0.875rem;
        line-height: 1.5;
        max-width: 260px;
    }

    #how-it-works .text-center.mt-5 {
        margin-top: 1.5rem !important;
    }

    #how-it-works .btn-lg {
        width: 100%;
        border-radius: 14px;
        padding: 1rem;
        font-weight: 600;
    }
}

/* ===== Pricing - Premium Card Stack ===== */
@media (max-width: 767.98px) {
    .pricing {
        background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
    }

    .pricing-toggle {
        gap: 0.75rem;
        margin-bottom: 2rem;
        background: rgba(0, 0, 0, 0.02);
        padding: 0.625rem 1rem;
        border-radius: 100px;
        display: inline-flex;
        width: auto;
        margin-left: auto;
        margin-right: auto;
    }

    /* Center the toggle */
    .pricing .section-title + .trial-banner + .pricing-toggle {
        display: flex;
        justify-content: center;
    }

    .toggle-label {
        font-size: 0.8125rem;
    }

    .toggle-switch {
        width: 44px;
        height: 24px;
        border-radius: 12px;
    }

    .toggle-knob {
        width: 18px;
        height: 18px;
    }

    .toggle-switch.active .toggle-knob {
        transform: translateX(20px);
    }

    .toggle-save {
        font-size: 0.6875rem;
        padding: 0.0625rem 0.375rem;
    }

    .trial-banner {
        padding: 0.75rem 1rem;
        margin-bottom: 1.5rem;
        border-radius: 14px;
    }

    .trial-content {
        flex-direction: row;
        text-align: left;
        gap: 0.5rem;
        font-size: 0.875rem;
    }

    .trial-content i {
        font-size: 1.125rem;
    }

    /* Card layout */
    .pricing-cards-row {
        display: flex;
        flex-direction: column;
        gap: 0 !important;
    }

    .pricing-cards-row > .col-lg-4:nth-child(2) {
        order: -1;
    }

    .pricing-cards-row > .col-lg-4 {
        padding-top: 0;
        padding-bottom: 0;
    }

    .pricing-card {
        padding: 1.5rem;
        margin-bottom: 0.75rem;
        border-radius: 18px;
        border: 1px solid rgba(0, 0, 0, 0.06);
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    }

    .pricing-card.featured {
        transform: none;
        margin-top: 0.75rem;
        padding: 1.75rem 1.5rem;
        border: 2px solid var(--accent-color);
        background: linear-gradient(180deg, rgba(93, 87, 244, 0.03) 0%, white 30%);
        box-shadow: 0 8px 32px rgba(93, 87, 244, 0.12);
    }

    .pricing-card.featured:hover {
        transform: none;
    }

    .pricing-card.featured::before {
        top: -12px;
        font-size: 0.6875rem;
        padding: 0.25rem 1rem;
    }

    .pricing-card .plan-name {
        font-size: 0.875rem;
        margin-bottom: 0.625rem;
    }

    .pricing-card .price-block {
        padding: 0.5rem 0;
    }

    .pricing-card .price {
        font-size: 2.25rem;
    }

    .pricing-card .price sup {
        font-size: 0.9375rem;
        margin-top: 0.375rem;
    }

    .pricing-card .period {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
        font-size: 0.8125rem;
    }

    .pricing-card .features-list {
        margin-bottom: 1.25rem;
    }

    .pricing-card .features-list li {
        font-size: 0.875rem;
        padding: 0.5rem 0;
        gap: 0.5rem;
    }

    .pricing-card .features-list li i {
        font-size: 0.875rem;
    }

    .pricing-card .btn {
        border-radius: 12px;
        padding: 0.875rem 1.5rem;
        font-size: 0.9375rem;
        font-weight: 600;
    }
}

/* ===== FAQ - Clean Accordion ===== */
@media (max-width: 767.98px) {
    .faq {
        background: #ffffff;
    }

    .accordion-item {
        border-radius: 14px !important;
        margin-bottom: 1rem;
        border: 1px solid rgba(0, 0, 0, 0.06) !important;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    }

    .accordion-button {
        padding: 1.125rem 1.25rem;
        font-size: 0.9375rem;
        font-weight: 600;
        border-radius: 14px !important;
    }

    .accordion-body {
        padding: 0 1.25rem 1.25rem;
        font-size: 0.875rem;
        line-height: 1.6;
    }

    .accordion-icon {
        font-size: 1.125rem;
    }
}

/* ===== CTA Section - App-like Banner ===== */
@media (max-width: 767.98px) {
    .call-to-action {
        padding: 3rem 0;
        border-radius: 0;
    }

    .cta-content h2 {
        font-size: 1.5rem;
        line-height: 1.2;
        letter-spacing: -0.01em;
    }

    .cta-content p {
        font-size: 0.9375rem;
        line-height: 1.5;
        margin-bottom: 1.5rem;
    }

    .cta-action {
        flex-direction: column;
        gap: 0.75rem;
    }

    .cta-action .btn {
        width: 100%;
        border-radius: 14px;
        padding: 1rem 1.5rem;
        font-weight: 600;
    }

    .cta-action .btn-primary {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    }
}

/* ===== Footer - Compact App Footer ===== */
@media (max-width: 767.98px) {
    .footer {
        padding: 2.5rem 0 1.5rem;
        text-align: center;
    }

    .footer-about {
        margin-bottom: 1.5rem;
    }

    .footer-about p {
        font-size: 0.875rem;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }

    .social-links {
        justify-content: center;
        gap: 0.625rem;
    }

    .social-links a {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    .footer-links {
        margin-bottom: 1.25rem;
    }

    .footer-links h4 {
        font-size: 0.875rem;
        margin-bottom: 0.75rem;
    }

    .footer-links li {
        margin-bottom: 0.5rem;
    }

    .footer-links a {
        font-size: 0.875rem;
    }

    .footer-contact p {
        justify-content: center;
        display: flex;
        align-items: center;
        font-size: 0.875rem;
    }

    .footer .copyright {
        padding-top: 1.5rem;
        margin-top: 1.5rem;
        font-size: 0.8125rem;
    }

    .footer .credits {
        margin-top: 0.5rem;
    }

    .footer .credits a {
        font-size: 0.8125rem;
    }
}

/* ==========================================================================
   APP PAGES - MOBILE (documents, editor, sign, billing, profile, etc.)
   ========================================================================== */

/* ===== Documents List Page Mobile ===== */
@media (max-width: 767.98px) {
    .documents-table {
        display: block;
    }

    .documents-table thead {
        display: none;
    }

    .documents-table tbody {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .documents-table tr {
        display: flex;
        flex-direction: column;
        background: white;
        border-radius: 12px;
        padding: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        border: 1px solid #e5e7eb;
    }

    .documents-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none !important;
    }

    .documents-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.75rem;
        text-transform: uppercase;
    }

    .documents-table td:last-child {
        padding-top: 1rem;
        margin-top: 0.5rem;
        border-top: 1px solid #f3f4f6 !important;
    }

    .documents-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .documents-header h1 {
        font-size: 1.5rem;
    }

    .documents-header .btn {
        width: 100%;
    }

    .documents-filters {
        flex-direction: column;
        gap: 0.75rem;
    }

    .documents-filters .form-select,
    .documents-filters .form-control {
        width: 100%;
    }
}

/* ===== Document Editor Mobile ===== */
@media (max-width: 991.98px) {
    .document-editor-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .editor-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        order: 2;
        border-left: none !important;
        border-top: 1px solid #e5e7eb;
        max-height: none;
    }

    .editor-main {
        order: 1;
        height: auto;
        min-height: 50vh;
    }

    .pdf-viewer-container {
        height: 50vh;
        min-height: 400px;
    }
}

@media (max-width: 767.98px) {
    .editor-toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .editor-toolbar .btn-group {
        flex-wrap: wrap;
    }

    .editor-toolbar .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .editor-sidebar {
        padding: 1rem;
    }

    .sidebar-section {
        margin-bottom: 1rem;
    }
}

/* ===== Sign Page Mobile ===== */
@media (max-width: 991.98px) {
    .sign-container {
        flex-direction: column;
    }

    .sign-sidebar {
        width: 100% !important;
        order: 2;
        max-height: none;
        border-left: none !important;
        border-top: 1px solid #e5e7eb;
    }

    .sign-main {
        order: 1;
    }

    .sign-pdf-viewer {
        height: 50vh;
        min-height: 400px;
    }
}

@media (max-width: 767.98px) {
    .sign-header {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        text-align: center;
    }

    .sign-header h1 {
        font-size: 1.125rem;
    }

    .signature-modal .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .signature-modal .modal-body {
        padding: 1rem;
    }

    .signature-pad-container {
        height: 150px;
    }

    .signature-pad-container canvas {
        height: 150px !important;
    }

    .signature-tile {
        padding: 0.75rem;
    }

    .signature-tile-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .font-option {
        padding: 0.5rem;
        font-size: 0.875rem;
    }

    .party-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .party-item .status-badge {
        align-self: flex-start;
    }

    .sign-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .sign-actions .btn {
        width: 100%;
    }

    .field-pill {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* ===== Verify Page Mobile ===== */
@media (max-width: 767.98px) {
    .verify-hero {
        padding: 2rem 0;
    }

    .verify-hero h1 {
        font-size: 1.5rem;
    }

    .verify-card {
        border-radius: 12px;
    }

    .verify-card-header {
        padding: 1rem;
    }

    .verify-card-header h5 {
        font-size: 1rem;
    }

    .verify-card-body {
        padding: 1rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .info-item {
        padding: 0.75rem;
    }

    .signer-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .signer-status {
        align-self: flex-start;
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }

    .hash-display {
        font-size: 0.65rem;
        padding: 0.75rem;
    }

    .upload-zone {
        padding: 2rem 1rem;
    }

    .upload-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .upload-zone h6 {
        font-size: 0.875rem;
    }
}

/* ===== Billing Page Mobile ===== */
@media (max-width: 767.98px) {
    .billing-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .billing-header h1 {
        font-size: 1.5rem;
    }

    .plan-card {
        padding: 1.25rem;
    }

    .plan-info {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .plan-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .plan-actions .btn {
        width: 100%;
    }

    .usage-stats {
        grid-template-columns: 1fr;
    }

    .billing-history-table {
        display: block;
        overflow-x: auto;
    }
}

/* ===== Profile Pages Mobile ===== */
@media (max-width: 767.98px) {
    .profile-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .profile-avatar {
        margin: 0 auto;
    }

    .profile-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .profile-nav .nav {
        flex-wrap: nowrap;
        white-space: nowrap;
    }

    .profile-form .row {
        margin: 0;
    }

    .profile-form .col-md-6 {
        padding: 0;
        margin-bottom: 1rem;
    }
}

/* ===== Tables Mobile ===== */
@media (max-width: 767.98px) {
    .table-responsive-card {
        display: block;
    }

    .table-responsive-card thead {
        display: none;
    }

    .table-responsive-card tbody {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .table-responsive-card tr {
        display: flex;
        flex-direction: column;
        background: white;
        border-radius: 10px;
        padding: 1rem;
        border: 1px solid #e5e7eb;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }

    .table-responsive-card td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 0.375rem 0;
        border: none !important;
        gap: 1rem;
    }

    .table-responsive-card td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.75rem;
        text-transform: uppercase;
        flex-shrink: 0;
    }
}

/* ===== Cards Mobile ===== */
@media (max-width: 767.98px) {
    .card {
        border-radius: 14px;
        border: 1px solid rgba(0, 0, 0, 0.06);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

    .card-header {
        padding: 1rem;
    }

    .card-body {
        padding: 1rem;
    }
}

/* ===== Forms Mobile ===== */
@media (max-width: 767.98px) {
    .form-control,
    .form-select {
        font-size: 16px;
        border-radius: 12px;
    }

    .form-floating > .form-control,
    .form-floating > .form-select {
        height: calc(3.5rem + 2px);
    }

    .input-group {
        flex-wrap: wrap;
    }

    .input-group .form-control {
        flex: 1 1 100%;
        margin-bottom: 0.5rem;
        border-radius: 12px !important;
    }

    .input-group .btn {
        flex: 1 1 100%;
        border-radius: 12px !important;
    }
}

/* ===== Buttons Mobile ===== */
@media (max-width: 767.98px) {
    .btn {
        padding: 0.625rem 1rem;
        border-radius: 12px;
    }

    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        border-radius: 14px;
    }

    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn-group-mobile .btn {
        width: 100%;
    }
}

/* ===== Modals Mobile ===== */
@media (max-width: 575.98px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-content {
        border-radius: 20px;
        border: none;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-footer .btn {
        width: 100%;
        margin: 0;
        border-radius: 12px;
    }
}

/* ===== Dropdowns Mobile ===== */
@media (max-width: 767.98px) {
    .dropdown-menu {
        min-width: 200px;
        border-radius: 14px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
        border: 1px solid rgba(0, 0, 0, 0.06);
    }

    .dropdown-item {
        padding: 0.625rem 1rem;
        border-radius: 8px;
    }
}

/* ===== Alerts Mobile ===== */
@media (max-width: 767.98px) {
    .alert {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
        border-radius: 14px;
    }
}

/* ===== Toast Notifications Mobile ===== */
@media (max-width: 575.98px) {
    #toast-container {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
    }

    .toast-notification {
        min-width: auto;
        width: 100%;
        border-radius: 14px;
    }
}

/* ===== PDF Viewer Mobile ===== */
@media (max-width: 767.98px) {
    .pdf-page-wrapper {
        margin: 0.5rem auto;
    }

    .pdf-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .pdf-controls .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .zoom-controls {
        order: 2;
        width: 100%;
        justify-content: center;
    }
}

/* ===== God Panel Mobile ===== */
@media (max-width: 991.98px) {
    .god-panel-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 1050;
        transition: left 0.3s ease;
    }

    .god-panel-sidebar.open {
        left: 0;
    }

    .god-panel-content {
        margin-left: 0 !important;
    }

    .god-panel-toggle {
        display: block !important;
    }
}

@media (max-width: 767.98px) {
    .god-panel-header {
        flex-direction: column;
        gap: 1rem;
    }

    .god-panel-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .god-panel-stat {
        padding: 1rem;
    }

    .god-panel-stat-value {
        font-size: 1.5rem;
    }
}

/* ===== Utility Classes for Mobile ===== */
@media (max-width: 767.98px) {
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }

    .text-center-mobile {
        text-align: center !important;
    }

    .flex-column-mobile {
        flex-direction: column !important;
    }

    .w-100-mobile {
        width: 100% !important;
    }

    .mb-3-mobile {
        margin-bottom: 1rem !important;
    }

    .p-2-mobile {
        padding: 0.5rem !important;
    }
}

/* ===== Touch-friendly improvements ===== */
@media (pointer: coarse) {
    .btn {
        min-height: 44px;
    }

    .form-control,
    .form-select {
        min-height: 44px;
    }

    .dropdown-item {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Disable hover transforms on touch */
    .btn:hover,
    .card:hover,
    .service-item:hover,
    .pricing-card:hover,
    .feature-box:hover {
        transform: none;
    }
}

/* ===== Safe area for notched devices ===== */
@supports (padding: max(0px)) {
    .header {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .footer {
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }

    #toast-container {
        bottom: max(10px, env(safe-area-inset-bottom));
        left: max(10px, env(safe-area-inset-left));
    }
}

/* ===== Landscape phone fixes ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 1.5rem 0;
    }

    .modal-body {
        max-height: 60vh;
        overflow-y: auto;
    }

    .sign-pdf-viewer {
        height: 70vh;
    }
}

/* ===== Small Phone Optimizations (< 400px) ===== */
@media (max-width: 400px) {
    .container {
        padding-left: 0.875rem;
        padding-right: 0.875rem;
    }

    .header {
        padding: 0.5rem 0;
    }

    .header .logo img {
        height: 26px;
    }

    /* Hero compact */
    .hero {
        padding: 2rem 0 1.5rem;
    }

    .hero h1 {
        font-size: 1.625rem !important;
    }

    .hero p {
        font-size: 0.875rem;
    }

    .company-badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }

    .hero-badges {
        flex-direction: column;
        gap: 0.375rem;
        align-items: center;
    }

    /* Sections tighter */
    .section {
        padding: 2.25rem 0;
    }

    .section-title h2 {
        font-size: 1.375rem;
    }

    /* Feature boxes 2x2 even tighter */
    .feature-box {
        padding: 0.75rem;
    }

    .feature-box .feature-icon {
        width: 38px;
        height: 38px;
        font-size: 1.125rem;
        border-radius: 10px;
    }

    .feature-box .feature-title {
        font-size: 1.125rem;
    }

    .feature-box .feature-text {
        font-size: 0.6875rem;
    }

    /* Service cards stacked on very small */
    .services .col-lg-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .service-item {
        padding: 1rem;
        flex-direction: row;
        text-align: left;
        gap: 1rem;
    }

    .service-icon {
        margin-bottom: 0;
        margin-left: 0;
        margin-right: 0;
    }

    .service-content h3 {
        font-size: 0.9375rem;
    }

    .service-content p {
        font-size: 0.8125rem;
        margin-bottom: 0.5rem;
    }

    /* Pricing compact */
    .pricing-card {
        padding: 1.25rem;
    }

    .pricing-card .price {
        font-size: 2rem;
    }

    .pricing-card .features-list li {
        font-size: 0.8125rem;
        padding: 0.4375rem 0;
    }

    /* Step cards compact */
    .step-number {
        width: 44px;
        height: 44px;
    }

    .step-number span {
        font-size: 1.25rem;
    }

    .step-card h4 {
        font-size: 1rem;
    }

    .step-card p {
        font-size: 0.8125rem;
    }

    /* App cards/pages */
    .card-body,
    .editor-card-body,
    .verify-card-body,
    .billing-card {
        padding: 0.875rem;
    }

    .card-header,
    .editor-card-header {
        padding: 0.75rem 0.875rem;
    }

    .documents-container {
        padding: 0.75rem 0.5rem;
    }

    .documents-header h1 {
        font-size: 1.125rem;
    }

    .document-card {
        padding: 0.75rem;
        border-radius: 10px;
    }

    .document-title {
        font-size: 0.875rem;
    }

    .status-tab {
        padding: 0.25rem 0.5rem;
        font-size: 0.65rem;
    }

    .billing-container {
        padding: 0.75rem 0.5rem;
    }

    .billing-header h1 {
        font-size: 1.125rem;
    }

    .plan-card {
        padding: 1rem;
    }

    .plan-price {
        font-size: 1.375rem;
    }

    .verify-hero {
        padding: 1.5rem 0;
    }

    .verify-hero h1 {
        font-size: 1.25rem;
    }

    .verify-card {
        border-radius: 10px;
    }

    .verify-card-header {
        padding: 0.875rem;
    }

    .verify-card-body {
        padding: 0.875rem;
    }

    .info-item {
        padding: 0.625rem;
    }

    .signer-item {
        padding: 0.625rem;
    }

    .signer-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }

    .sign-header {
        padding: 0.625rem 0.75rem;
    }

    .sign-content {
        padding: 0.5rem;
    }

    /* Buttons smaller */
    .btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.8125rem;
    }

    .btn-lg {
        padding: 0.75rem 1rem;
        font-size: 0.9375rem;
    }

    .btn-sm {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }

    /* Modal */
    .modal-dialog {
        margin: 0.375rem;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 0.875rem;
    }

    /* Footer */
    .footer {
        padding: 2rem 0 1rem;
    }

    .footer h4 {
        font-size: 0.8125rem;
        margin-bottom: 0.75rem;
    }

    .footer-links a,
    .footer-about p {
        font-size: 0.8125rem;
    }

    /* Auth pages */
    .auth-card {
        padding: 1.5rem;
        margin: 0.5rem;
        border-radius: 18px;
    }

    .auth-title {
        font-size: 1.375rem;
    }

    /* Empty states */
    .empty-state,
    .no-subscription {
        padding: 1.5rem 0.75rem;
    }

    .empty-state i,
    .no-subscription i {
        font-size: 2rem;
    }

    .dropzone-large {
        padding: 1.5rem 0.75rem;
    }

    .dropzone-icon-large {
        font-size: 2rem;
    }

    .dropzone-text-large {
        font-size: 0.9rem;
    }
}

/* ===== Very Small Phone (< 350px) ===== */
@media (max-width: 350px) {
    .container {
        padding-left: 0.625rem;
        padding-right: 0.625rem;
    }

    .hero h1 {
        font-size: 1.375rem !important;
    }

    .section-title h2 {
        font-size: 1.25rem;
    }

    .documents-header h1,
    .billing-header h1,
    .verify-hero h1 {
        font-size: 1rem;
    }

    .document-card,
    .verify-card,
    .billing-card,
    .card {
        border-radius: 10px;
    }

    .card-body,
    .verify-card-body {
        padding: 0.75rem;
    }

    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .status-badge {
        font-size: 0.55rem;
        padding: 0.15rem 0.375rem;
    }

    .pricing-card .price {
        font-size: 1.75rem;
    }

    /* Stats 1 column on tiny phones */
    .feature-boxes .col-lg-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .feature-box {
        flex-direction: row;
        text-align: left;
        gap: 0.75rem;
    }

    .feature-box .feature-icon {
        margin-bottom: 0;
    }
}
