/* ========================================
   CIPHERIQ LOGIN SCREEN
======================================== */

.hidden {
    display: none !important;
}


/* ========================================
   FULL SCREEN LOGIN
======================================== */

.login-screen {
    position: fixed;
    inset: 0;

    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;

    overflow-x: hidden;
    overflow-y: auto;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        Helvetica,
        sans-serif;

    color: #ffffff;

    background:
        radial-gradient(
            circle at 15% 20%,
            rgba(14, 165, 233, 0.25),
            transparent 30%
        ),
        radial-gradient(
            circle at 85% 75%,
            rgba(37, 99, 235, 0.22),
            transparent 32%
        ),
        radial-gradient(
            circle at 55% 45%,
            rgba(8, 47, 73, 0.20),
            transparent 38%
        ),
        linear-gradient(
            135deg,
            #020617 0%,
            #06152d 48%,
            #020817 100%
        );
}


/* ========================================
   TECHNOLOGY GRID
======================================== */

.login-overlay {
    position: fixed;
    inset: 0;

    z-index: 0;

    pointer-events: none;

    opacity: 0.28;

    background-image:
        linear-gradient(
            rgba(56, 189, 248, 0.07) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(56, 189, 248, 0.07) 1px,
            transparent 1px
        );

    background-size:
        60px 60px;
}


/* ========================================
   PAGE
======================================== */

.login-page {
    position: relative;
    z-index: 1;

    width: min(92%, 1300px);
    min-height: 100vh;
    min-height: 100dvh;

    margin: 0 auto;

    padding:
        28px
        20px;

    display: flex;
    flex-direction: column;

    box-sizing: border-box;
}


/* ========================================
   BRAND
======================================== */

.login-brand {
    width: 100%;

    min-height: 60px;

    display: flex;
    align-items: center;

    flex-shrink: 0;
}

.cipheriq-logo {
    font-size:
        clamp(30px, 2.5vw, 38px);

    line-height: 1;

    font-weight: 800;

    letter-spacing: -1.5px;

    color: #ffffff;
}

.cipheriq-logo span {
    color: #38bdf8;
}


/* ========================================
   MAIN LAYOUT
======================================== */

.login-layout {
    flex: 1;

    width: 100%;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(330px, 390px);

    gap:
        clamp(50px, 8vw, 120px);

    align-items: center;

    box-sizing: border-box;
}


/* ========================================
   HERO
======================================== */

.login-hero {
    width: 100%;

    display: flex;
    align-items: center;

    box-sizing: border-box;
}

.login-hero-content {
    width: 100%;
    max-width: 650px;

    box-sizing: border-box;
}


/* ========================================
   HEADLINE
======================================== */

.login-hero-content h1 {
    margin: 0;

    font-size:
        clamp(48px, 5vw, 76px);

    line-height: 0.98;

    font-weight: 800;

    letter-spacing: -3px;

    color: #ffffff;

    text-shadow:
        0 4px 30px
        rgba(0, 0, 0, 0.25);
}

.login-hero-content h1 span {
    display: block;

    margin-top: 7px;

    color: #38bdf8;
}


/* ========================================
   FEATURES
======================================== */

.login-features {
    width: 100%;
    max-width: 620px;

    margin-top: 42px;

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    box-sizing: border-box;
}

.login-feature {
    min-width: 0;

    padding:
        10px
        12px;

    text-align: center;

    border-right:
        1px solid
        rgba(255, 255, 255, 0.16);

    box-sizing: border-box;
}

.login-feature:first-child {
    padding-left: 0;
}

.login-feature:last-child {
    border-right: none;
}

.feature-icon {
    margin-bottom: 8px;

    font-size: 26px;

    color: #38bdf8;
}

.login-feature strong {
    display: block;

    font-size: 13px;
    font-weight: 700;

    color: #ffffff;
}

.login-feature span {
    display: block;

    margin-top: 3px;

    font-size: 11px;

    color: #94a3b8;
}


/* ========================================
   LOGIN CARD
======================================== */

.login-card {
    width: 100%;
    max-width: 390px;

    margin: 0 auto;

    padding: 32px;

    box-sizing: border-box;

    border:
        1px solid
        rgba(148, 163, 184, 0.22);

    border-radius: 18px;

    background:
        linear-gradient(
            145deg,
            rgba(10, 31, 65, 0.82),
            rgba(5, 18, 42, 0.74)
        );

    backdrop-filter:
        blur(18px);

    -webkit-backdrop-filter:
        blur(18px);

    box-shadow:
        0 24px 70px
        rgba(0, 0, 0, 0.32);
}

.login-card h2 {
    margin:
        0
        0
        7px;

    font-size: 27px;
    font-weight: 750;

    color: #ffffff;
}

.login-subtitle {
    margin:
        0
        0
        25px;

    font-size: 14px;

    color: #94a3b8;
}


/* ========================================
   LOGIN FORM
======================================== */

#login-form {
    width: 100%;

    display: flex;
    flex-direction: column;

    box-sizing: border-box;
}

#login-form,
#login-form * {
    box-sizing: border-box;
}

#login-form label {
    margin-bottom: 7px;

    font-size: 13px;
    font-weight: 600;

    color: #cbd5e1;
}

#login-form input {
    display: block;

    width: 100%;
    max-width: 100%;

    min-height: 48px;

    margin:
        0
        0
        16px;

    padding:
        12px
        14px;

    border:
        1px solid
        rgba(148, 163, 184, 0.30);

    border-radius: 9px;

    outline: none;

    background:
        rgba(15, 35, 59, 0.88);

    color: #ffffff;

    font-family: inherit;
    font-size: 16px;

    box-sizing: border-box;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

#login-form input::placeholder {
    color: #64748b;
}

#login-form input:focus {
    border-color: #38bdf8;

    box-shadow:
        0 0 0 3px
        rgba(56, 189, 248, 0.13);
}


/* ========================================
   SIGN IN BUTTON
======================================== */

#login-form button {
    display: block;

    width: 100%;
    max-width: 100%;

    min-height: 50px;

    margin: 0;

    padding: 13px;

    border: none;
    border-radius: 9px;

    background:
        linear-gradient(
            90deg,
            #0284c7,
            #2563eb
        );

    color: #ffffff;

    font-family: inherit;
    font-size: 16px;
    font-weight: 700;

    cursor: pointer;

    box-sizing: border-box;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

#login-form button:hover:not(:disabled) {
    transform: translateY(-1px);

    box-shadow:
        0 8px 26px
        rgba(37, 99, 235, 0.32);
}

#login-form button:disabled {
    opacity: 0.6;

    cursor: not-allowed;
}


/* ========================================
   LOGIN ERROR
======================================== */

.login-error {
    min-height: 20px;

    margin-bottom: 10px;

    color: #fca5a5;

    font-size: 13px;

    text-align: center;
}


/* ========================================
   TABLET / SMALL LAPTOP
======================================== */

@media (max-width: 950px) {

    .login-page {
        width: 94%;

        padding:
            24px
            10px
            36px;
    }

    .login-layout {
        grid-template-columns:
            minmax(0, 1fr)
            340px;

        gap: 36px;
    }

    .login-hero-content h1 {
        font-size:
            clamp(40px, 6vw, 56px);

        letter-spacing: -2px;
    }

    .login-features {
        grid-template-columns:
            repeat(2, 1fr);

        max-width: 370px;

        row-gap: 16px;
    }

    .login-feature:nth-child(2) {
        border-right: none;
    }
}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 700px) {

    .login-screen {
        width: 100%;
        min-height: 100dvh;
    }

    .login-page {
        width: 100%;
        max-width: none;

        min-height: 100dvh;

        margin: 0;

        padding:
            20px
            20px
            34px;

        align-items: center;
    }


    /* BRAND */

    .login-brand {
        width: 100%;

        min-height: 48px;

        justify-content: flex-start;
    }

    .cipheriq-logo {
        font-size: 28px;
    }


    /* STACK */

    .login-layout {
        flex: 1;

        width: 100%;

        display: flex;
        flex-direction: column;

        align-items: center;
        justify-content: center;

        gap: 32px;

        padding:
            45px
            0
            20px;

        box-sizing: border-box;
    }


    /* HERO */

    .login-hero {
        width: 100%;

        display: block;
    }

    .login-hero-content {
        width: 100%;
        max-width: 390px;

        margin: 0 auto;
    }


    /* HEADLINE */

    .login-hero-content h1 {
        font-size:
            clamp(36px, 10vw, 48px);

        line-height: 1;

        letter-spacing: -1.8px;
    }


    /* FEATURES */

    .login-features {
        width: 100%;
        max-width: 390px;

        margin-top: 28px;

        grid-template-columns:
            repeat(4, minmax(0, 1fr));
    }

    .login-feature {
        padding:
            7px
            3px;
    }

    .login-feature:first-child {
        padding-left: 3px;
    }

    .feature-icon {
        margin-bottom: 5px;

        font-size: 21px;
    }

    .login-feature strong {
        font-size: 10px;
    }

    .login-feature span {
        font-size: 8px;
    }


    /* CARD */

    .login-card {
        width: 100%;
        max-width: 390px;

        margin: 0 auto;

        padding:
            24px
            20px;

        box-sizing: border-box;
    }

    .login-card h2 {
        font-size: 23px;
    }

    .login-subtitle {
        margin-bottom: 20px;

        font-size: 13px;
    }


    /* FORM */

    #login-form {
        width: 100%;
        max-width: 100%;

        box-sizing: border-box;
    }

    #login-form input {
        width: 100%;
        max-width: 100%;

        min-height: 46px;

        margin-bottom: 13px;

        padding:
            10px
            12px;

        box-sizing: border-box;
    }

    #login-form button {
        width: 100%;
        max-width: 100%;

        min-height: 48px;

        box-sizing: border-box;
    }
}


/* ========================================
   SMALL MOBILE
======================================== */

@media (max-width: 390px) {

    .login-page {
        padding-left: 15px;
        padding-right: 15px;
    }

    .login-layout {
        padding-top: 32px;

        gap: 27px;
    }

    .login-hero-content h1 {
        font-size: 34px;
    }

    .login-features {
        margin-top: 22px;
    }

    .login-card {
        padding:
            21px
            17px;
    }
}


/* ========================================
   SHORT LAPTOP SCREENS
======================================== */

@media (min-width: 701px) and (max-height: 700px) {

    .login-page {
        padding-top: 15px;
        padding-bottom: 15px;
    }

    .login-brand {
        min-height: 44px;
    }

    .login-hero-content h1 {
        font-size:
            clamp(38px, 4.5vw, 58px);
    }

    .login-features {
        margin-top: 25px;
    }

    .login-card {
        padding: 26px;
    }
}



/* ========================================
   AVA DRIVER APPLICATION
======================================== */

.app {
    width: 100%;
    max-width: 520px;
    height: 100vh;
    height: 100dvh;

    margin: 0 auto;

    background: #ffffff;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        Helvetica,
        sans-serif;

    color: #1f2937;
}


/* ========================================
   DRIVER HEADER
======================================== */

.app-header {
    flex-shrink: 0;

    padding: 17px 18px;

    background:
        linear-gradient(
            135deg,
            #172554,
            #1e3a8a
        );

    color: #ffffff;

    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 15px;
}

.app-header h1 {
    margin: 0 0 4px;

    font-size: 21px;
    line-height: 1.1;

    font-weight: 750;
}

.app-header p {
    margin: 0;

    font-size: 12px;

    opacity: 0.82;
}


/* ========================================
   HEADER ACTIONS
======================================== */

.header-actions {
    display: flex;
    align-items: center;

    gap: 8px;

    flex-shrink: 0;
}

.status {
    padding:
        6px
        10px;

    border-radius: 20px;

    background: #166534;

    color: #ffffff;

    font-size: 11px;
    font-weight: 700;
}

.logout-btn {
    padding:
        6px
        10px;

    border:
        1px solid
        rgba(255, 255, 255, 0.45);

    border-radius: 8px;

    background: transparent;

    color: #ffffff;

    font-size: 11px;
    font-weight: 600;

    cursor: pointer;
}

.logout-btn:hover {
    background:
        rgba(255, 255, 255, 0.10);
}


/* ========================================
   CHAT AREA
======================================== */

.chat {
    flex: 1;

    min-height: 0;

    overflow-y: auto;

    padding:
        20px
        16px;

    display: flex;
    flex-direction: column;

    gap: 14px;

    background:
        linear-gradient(
            180deg,
            #f8fafc,
            #ffffff
        );

    scroll-behavior: smooth;
}


/* ========================================
   CHAT MESSAGES
======================================== */

.message {
    max-width: 85%;

    padding:
        12px
        14px;

    border-radius: 14px;

    line-height: 1.45;

    box-sizing: border-box;
}

.agent-message {
    align-self: flex-start;

    border:
        1px solid
        #e2e8f0;

    background: #f1f5f9;

    color: #1f2937;

    border-bottom-left-radius: 4px;
}

.driver-message {
    align-self: flex-end;

    background: #172554;

    color: #ffffff;

    border-bottom-right-radius: 4px;
}

.message-label {
    margin-bottom: 5px;

    font-size: 11px;
    font-weight: 750;
}

.agent-message .message-label {
    color: #2563eb;
}

.driver-message .message-label {
    color: #bfdbfe;
}

.message-text {
    font-size: 15px;

    overflow-wrap: anywhere;
}


/* ========================================
   ACTIVE REPORT
======================================== */

.active-report {
    flex-shrink: 0;

    margin:
        8px
        16px
        0;

    padding:
        9px
        12px;

    border:
        1px solid
        #d1d5db;

    border-radius: 8px;

    background: #f1f5f9;

    color: #374151;

    font-size: 12px;
    font-weight: 650;

    text-align: center;
}


/* ========================================
   REPORT ACTIONS
======================================== */

.report-actions {
    flex-shrink: 0;

    display: flex;

    gap: 8px;

    margin:
        8px
        16px;
}

.report-actions button {
    flex: 1;

    min-height: 40px;

    padding:
        9px
        10px;

    border: none;
    border-radius: 8px;

    font-family: inherit;

    font-size: 13px;
    font-weight: 650;

    cursor: pointer;

    box-sizing: border-box;
}

#add-more-photos-btn {
    background: #e5e7eb;

    color: #1f2937;
}

#finish-report-btn {
    background: #166534;

    color: #ffffff;
}


/* ========================================
   QUICK ACTIONS
======================================== */

.quick-actions {
    flex-shrink: 0;

    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 8px;

    padding:
        12px
        16px;

    border-top:
        1px solid
        #e5e7eb;

    background: #ffffff;
}

.quick-actions button {
    min-width: 0;
    min-height: 42px;

    padding:
        9px
        6px;

    border:
        1px solid
        #d1d5db;

    border-radius: 10px;

    background: #ffffff;

    color: #1f2937;

    font-family: inherit;

    font-size: 12px;
    font-weight: 650;

    cursor: pointer;

    box-sizing: border-box;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}

.quick-actions button:hover {
    background: #f8fafc;

    border-color: #94a3b8;
}

.quick-actions button:active {
    transform: scale(0.98);
}

.photo-btn {
    color: #075985 !important;

    border-color: #bae6fd !important;

    background: #f0f9ff !important;
}

#incident-btn {
    color: #991b1b;

    border-color: #fecaca;

    background: #fef2f2;
}


/* ========================================
   MESSAGE INPUT
======================================== */

.chat-input {
    flex-shrink: 0;

    display: flex;

    gap: 8px;

    padding:
        11px
        16px
        12px;

    border-top:
        1px solid
        #e5e7eb;

    background: #ffffff;
}

.chat-input,
.chat-input * {
    box-sizing: border-box;
}

.chat-input input {
    flex: 1;

    min-width: 0;
    min-height: 46px;

    padding:
        11px
        13px;

    border:
        1px solid
        #d1d5db;

    border-radius: 10px;

    outline: none;

    background: #ffffff;

    color: #111827;

    font-family: inherit;
    font-size: 16px;
}

.chat-input input:focus {
    border-color: #2563eb;

    box-shadow:
        0 0 0 3px
        rgba(37, 99, 235, 0.10);
}

.chat-input button {
    flex-shrink: 0;

    min-height: 46px;

    padding:
        0
        18px;

    border: none;

    border-radius: 10px;

    background: #172554;

    color: #ffffff;

    font-family: inherit;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;
}

.chat-input button:hover {
    background: #1e3a8a;
}


/* ========================================
   FOOTER
======================================== */

.app-footer {
    flex-shrink: 0;

    padding:
        4px
        12px
        8px;

    background: #ffffff;

    color: #64748b;

    text-align: center;

    font-size: 10px;
    font-weight: 600;
}


/* ========================================
   EMERGENCY MESSAGE
======================================== */

.emergency-message {
    align-self: stretch;

    margin:
        4px
        0;

    padding: 15px;

    border:
        2px solid
        #b91c1c;

    border-radius: 12px;

    background: #fef2f2;
}

.emergency-title {
    margin-bottom: 9px;

    color: #991b1b;

    font-size: 17px;
    font-weight: 800;
}

.emergency-text {
    color: #7f1d1d;

    font-size: 14px;
    font-weight: 600;

    line-height: 1.5;
}


/* ========================================
   DRIVER DESKTOP
======================================== */

@media (min-width: 701px) {

    body:has(#driver-app:not(.hidden)) {
        margin: 0;

        min-height: 100vh;

        padding: 28px;

        box-sizing: border-box;

        background:
            linear-gradient(
                135deg,
                #e8eef8,
                #f8fafc
            );
    }

    .app {
        width: min(100%, 520px);

        height:
            calc(100vh - 56px);

        border:
            1px solid
            #e2e8f0;

        border-radius: 18px;

        box-shadow:
            0 18px 55px
            rgba(15, 23, 42, 0.16);
    }
}


/* ========================================
   DRIVER MOBILE
======================================== */

@media (max-width: 700px) {

    body:has(#driver-app:not(.hidden)) {
        margin: 0;

        padding: 0;

        width: 100%;

        min-height: 100dvh;

        background: #ffffff;
    }

    .app {
        width: 100%;
        max-width: none;

        height: 100dvh;

        margin: 0;

        border: none;
        border-radius: 0;

        box-shadow: none;
    }

    .app-header {
        padding:
            14px
            15px;
    }

    .app-header h1 {
        font-size: 19px;
    }

    .app-header p {
        font-size: 11px;
    }

    .chat {
        padding:
            16px
            14px;
    }

    .message {
        max-width: 90%;
    }

    .quick-actions {
        padding:
            10px
            12px;

        gap: 6px;
    }

    .quick-actions button {
        min-height: 40px;

        padding:
            8px
            4px;

        font-size: 11px;
    }

    .chat-input {
        padding:
            10px
            12px
            calc(
                10px +
                env(safe-area-inset-bottom)
            );
    }

    .chat-input button {
        padding:
            0
            15px;
    }

    .app-footer {
        display: none;
    }
}


/* ========================================
   VERY SMALL MOBILE
======================================== */

@media (max-width: 390px) {

    .header-actions {
        gap: 5px;
    }

    .status,
    .logout-btn {
        padding:
            5px
            7px;

        font-size: 10px;
    }

    .quick-actions button {
        font-size: 10px;
    }
}