/* Shared Driver portal mobile shell. Loaded last to contain legacy page styles. */
:root {
    --driver-nav-height: 72px;
    --driver-page-gutter: clamp(0.85rem, 3vw, 1.5rem);
    --driver-touch-target: 50px;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body.app-shell-body {
    overflow-x: hidden;
    background-color: var(--bg-base, #05060f);
    color: var(--text-primary, #f4f6ff);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
}

.app-shell-body h1,
.app-shell-body h2,
.app-shell-body h3,
.app-shell-body h4,
.app-shell-body h5,
.app-shell-body h6 {
    font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.app-shell-body h1,
.app-shell-body .h1 { font-size: clamp(1.85rem, 5vw, 3rem); }
.app-shell-body h2,
.app-shell-body .h2 { font-size: clamp(1.45rem, 4vw, 2.2rem); }
.app-shell-body h3,
.app-shell-body .h3 { font-size: clamp(1.2rem, 3vw, 1.65rem); }

.app-shell-body p,
.app-shell-body label,
.app-shell-body .form-text,
.app-shell-body .text-muted {
    text-wrap: pretty;
}

.app-shell-body .app-chrome {
    min-height: 68px;
}

.driver-brand-logo {
    display: block;
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.app-shell-body .brand-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.mobile-app-nav {
    display: none;
}

.mobile-more-sheet {
    display: none;
}

.app-shell-body .form-control,
.app-shell-body .form-select,
.app-shell-body textarea.form-control {
    min-height: var(--driver-touch-target);
    border-radius: 14px;
    padding: 0.75rem 0.9rem;
    background-color: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text-primary, #f4f6ff);
    font-size: 1rem;
}

.app-shell-body textarea.form-control {
    min-height: 112px;
}

.app-shell-body .form-control:focus,
.app-shell-body .form-select:focus {
    border-color: var(--brand-secondary, #42e3ff);
    box-shadow: 0 0 0 3px rgba(66, 227, 255, 0.18);
}

.app-shell-body .form-label,
.app-shell-body .form-group label {
    margin-bottom: 0.45rem;
    color: #c8d0e7;
    font-size: 0.9rem;
    font-weight: 600;
}

.app-shell-body .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.15rem;
}

.app-shell-body .btn {
    min-height: 46px;
    border-radius: 14px;
    padding: 0.65rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.95rem;
    font-weight: 650;
}

.app-shell-body .btn-primary {
    background: #6c8cff;
    border-color: #6c8cff;
    color: #081021;
}

.app-shell-body .btn-success {
    background: #43d89b;
    border-color: #43d89b;
    color: #07140f;
}

.app-shell-body .btn-secondary {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.14);
    color: #eef2ff;
}

.app-shell-body .btn-danger {
    background: rgba(248, 113, 113, 0.16);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

.app-shell-body .card {
    overflow: hidden;
    border-radius: 20px;
}

.app-shell-body .card-header {
    padding: 1.15rem 1.25rem;
    background: rgba(255, 255, 255, 0.025);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.app-shell-body .card-body {
    padding: 1.25rem;
}

.app-shell-body .alert {
    border: 1px solid currentColor;
    border-radius: 14px;
    font-size: 0.92rem;
}

.app-shell-body .table-responsive {
    border-radius: 14px;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 991.98px) {
    body.app-shell-body {
        padding-bottom: calc(var(--driver-nav-height) + env(safe-area-inset-bottom));
    }

    .app-bg-glow {
        opacity: 0.28;
        filter: blur(60px);
    }

    .app-shell-header {
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
    }

    .app-shell-body .app-chrome {
        min-height: 60px;
        padding: 0.45rem var(--driver-page-gutter);
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.55rem;
    }

    .app-shell-body .brand-mark {
        min-width: 0;
        gap: 0.6rem;
    }

    .driver-brand-logo {
        width: 44px !important;
        height: 44px !important;
    }

    .app-shell-body .brand-glyph {
        width: 40px;
        height: 40px;
        border-radius: 13px;
    }

    .app-shell-body .brand-title {
        display: block;
        font-size: 1rem;
        font-weight: 700;
    }

    .app-shell-body .brand-subtitle {
        display: block;
        max-width: 52vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.62rem;
        letter-spacing: 0.12em;
    }

    .app-shell-body .menu-toggle,
    .app-shell-body .dvsa-mobile-toggle {
        display: inline-flex;
        width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        margin-left: auto;
        border-radius: 14px;
        font-size: 1.3rem;
    }

    .app-shell-body .primary-nav,
    .app-shell-body .auth-cluster {
        display: none;
        width: 100%;
    }

    .app-shell-body.mobile-nav-open .primary-nav,
    .app-shell-body.mobile-nav-open .auth-cluster {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.45rem;
        margin: 0.2rem 0 0.45rem;
    }

    .app-shell-body.mobile-nav-open .primary-nav > *,
    .app-shell-body.mobile-nav-open .auth-cluster > *,
    .app-shell-body.mobile-nav-open .auth-cluster form,
    .app-shell-body.mobile-nav-open .auth-cluster .btn {
        width: 100%;
    }

    .app-shell-main {
        width: 100%;
        max-width: none;
        padding: 0;
    }

    .app-shell-main > main {
        min-height: calc(100dvh - 60px - var(--driver-nav-height));
        padding: var(--driver-page-gutter);
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .app-shell-main > main > .container,
    .app-shell-main > main > .container-fluid,
    .app-shell-main > main > .container-xl,
    .app-shell-main > main section > .container {
        max-width: none;
        padding-left: 0;
        padding-right: 0;
    }

    .app-shell-main > main > .container.mt-5 {
        margin-top: 0 !important;
    }

    .mobile-app-nav {
        position: fixed;
        z-index: 50;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        min-height: var(--driver-nav-height);
        padding: 0.45rem max(0.5rem, env(safe-area-inset-right)) max(0.45rem, env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(7, 9, 20, 0.94);
        box-shadow: 0 -10px 35px rgba(0, 0, 0, 0.38);
        backdrop-filter: blur(22px) saturate(160%);
    }

    .mobile-app-nav__item {
        min-width: 0;
        min-height: 54px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.15rem;
        border-radius: 14px;
        color: #9ca8c9;
        border: 0;
        background: transparent;
        text-decoration: none;
        font-family: inherit;
        font-size: 0.68rem;
        font-weight: 650;
        cursor: pointer;
    }

    .mobile-app-nav__item i {
        font-size: 1.25rem;
        line-height: 1;
    }

    .mobile-app-nav__item:active,
    .mobile-app-nav__item:focus-visible,
    .mobile-app-nav__item[aria-expanded="true"] {
        background: rgba(66, 227, 255, 0.1);
        color: #8be8ff;
    }

    body.mobile-sheet-open {
        overflow: hidden;
    }

    .mobile-more-sheet:not([hidden]) {
        position: fixed;
        z-index: 45;
        inset: 0;
        display: block;
    }

    .mobile-more-sheet__backdrop {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        border: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(3px);
    }

    .mobile-more-sheet__panel {
        position: absolute;
        right: 0;
        bottom: calc(var(--driver-nav-height) + env(safe-area-inset-bottom));
        left: 0;
        max-height: min(70dvh, 520px);
        overflow-y: auto;
        padding: 1rem var(--driver-page-gutter) 1.25rem;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 24px 24px 0 0;
        background: #101321;
        box-shadow: 0 -20px 55px rgba(0, 0, 0, 0.5);
    }

    .mobile-more-sheet__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .mobile-more-sheet__header h2 {
        margin: 0;
        font-size: 1.45rem;
    }

    .mobile-more-sheet__eyebrow {
        display: block;
        margin-bottom: 0.15rem;
        color: #8995b5;
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
    }

    .mobile-more-sheet__close {
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
        display: grid;
        place-items: center;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.05);
        color: #eef2ff;
        font-size: 1.15rem;
    }

    .mobile-more-sheet__grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    .mobile-more-sheet__grid a {
        min-height: 82px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 0.35rem;
        padding: 0.85rem;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.04);
        color: #e7ebf8;
        text-decoration: none;
        font-size: 0.85rem;
        font-weight: 650;
    }

    .mobile-more-sheet__grid a i {
        color: #72ddff;
        font-size: 1.35rem;
    }

    .mobile-more-sheet__logout {
        margin-top: 0.75rem;
    }

    .mobile-more-sheet__logout button {
        width: 100%;
        min-height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        border: 1px solid rgba(248, 113, 113, 0.28);
        border-radius: 15px;
        background: rgba(248, 113, 113, 0.1);
        color: #fecaca;
        font-family: inherit;
        font-weight: 700;
    }

    .app-shell-footer {
        display: none;
    }

    .app-shell-body .hero {
        padding: 2rem 1.15rem;
        border-radius: 22px;
        text-align: left;
    }

    .app-shell-body .hero p {
        margin-bottom: 1.5rem;
        font-size: 1rem;
    }

    .app-shell-body .simple-info,
    .app-shell-body .id-creation {
        padding: 1.25rem 0;
        background: transparent;
        border: 0;
    }

    .app-shell-body .info-grid,
    .app-shell-body .feature-cards {
        gap: 0.85rem;
    }

    .app-shell-body .info-item,
    .app-shell-body .feature-card,
    .app-shell-body .form-wrapper {
        padding: 1.15rem;
        border-radius: 18px;
    }

    .app-shell-body .section-title {
        margin-bottom: 1.25rem;
        text-align: left;
    }

    .app-shell-body .section-title h2::after {
        left: 0;
        transform: none;
        width: 56px;
    }

    .driver-profile {
        padding: 0 !important;
        background: transparent !important;
    }

    .driver-profile .profile-sidebar {
        display: none;
    }

    .driver-profile .profile-userpic {
        display: none;
    }

    .driver-profile .profile-usertitle {
        margin: 0 0 0.7rem;
        text-align: left;
    }

    .driver-profile .profile-usertitle-name {
        font-size: 1.15rem;
        color: #f4f6ff;
    }

    .driver-profile .profile-usertitle-job {
        font-size: 0.78rem;
    }

    .driver-profile .profile-usermenu {
        margin-top: 0;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .driver-profile .profile-usermenu::-webkit-scrollbar { display: none; }

    .driver-profile .profile-usermenu .nav {
        width: max-content;
        flex-direction: row !important;
        gap: 0.4rem;
    }

    .driver-profile .profile-usermenu .nav-link {
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        padding: 0.55rem 0.75rem;
        border-radius: 12px;
        white-space: nowrap;
        background: rgba(255, 255, 255, 0.04);
        color: #b7c1dc;
        font-size: 0.82rem;
    }

    .driver-profile .profile-usermenu .nav-link.active {
        background: rgba(66, 227, 255, 0.12);
        color: #8be8ff;
    }

    .driver-profile .profile-content {
        padding: 0;
        background: transparent;
    }

    .driver-profile .tab-pane {
        padding: 0;
    }
}

@media (max-width: 575.98px) {
    .app-shell-body .card-header,
    .app-shell-body .card-body {
        padding: 1rem;
    }

    .app-shell-body .card-title {
        font-size: 1.35rem;
    }

    .app-shell-body .form-step h3 {
        margin-bottom: 1.25rem !important;
    }

    .app-shell-body .form-step .d-flex.justify-content-between,
    .app-shell-body .form-step .d-flex.justify-content-end {
        gap: 0.65rem;
    }

    .app-shell-body .form-step .d-flex.justify-content-between .btn,
    .app-shell-body .form-step .d-flex.justify-content-end .btn,
    .app-shell-body .form-actions .btn {
        flex: 1 1 0;
        width: auto;
    }

    .app-shell-body .wizard-progress {
        gap: 0.55rem;
    }

    .app-shell-body .wizard-progress__label {
        min-width: 0;
        width: 100%;
        font-size: 0.7rem;
    }

    .app-shell-body .table {
        font-size: 0.82rem;
    }

    .app-shell-body .table > :not(caption) > * > * {
        padding: 0.7rem 0.55rem;
        white-space: nowrap;
    }
}

@media (hover: none) {
    .app-shell-body .btn:hover,
    .app-shell-body .card:hover,
    .app-shell-body .feature-card:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-shell-body *,
    .app-shell-body *::before,
    .app-shell-body *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
