/* =========================================================
   Danutel Customer Authentication
   مكامل با Danukala Design System
   Login + OTP Verify
   ========================================================= */


/* =========================================================
   Page
   ========================================================= */

.auth-page {
    min-height: 100vh;
    overflow-x: hidden;
    background: linear-gradient( 180deg, #ffffff 0%, var(--dk-background) 100% );
    color: var(--dk-text);
}


/* =========================================================
   Shell
   ========================================================= */

.auth-shell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--space-8) var(--container-gutter);
}


/* =========================================================
   Background Detail
   ========================================================= */

.auth-ambient {
    position: fixed;
    z-index: 0;
    border-radius: 50%;
    pointer-events: none;
}

.auth-ambient-one {
    top: -180px;
    right: -170px;
    width: 400px;
    height: 400px;
    background: rgba(23, 52, 110, 0.05);
}

.auth-ambient-two {
    bottom: -190px;
    left: -180px;
    width: 420px;
    height: 420px;
    background: rgba(24, 181, 207, 0.05);
}


/* =========================================================
   Main Card
   ========================================================= */

.auth-card {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(320px, 0.88fr) minmax(440px, 1.12fr);
    width: min(100%, 1040px);
    min-height: 620px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--dk-border);
    border-radius: 24px;
    box-shadow: 0 16px 48px rgba(16, 38, 80, 0.08);
}


/* =========================================================
   Brand Side
   ========================================================= */

.auth-brand-side {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: var(--space-8);
    overflow: hidden;
    color: #ffffff;
    background: linear-gradient( 145deg, #102650 0%, #17346e 58%, #087fa4 100% );
}

    .auth-brand-side::before {
        content: "";
        position: absolute;
        top: -90px;
        left: -90px;
        width: 240px;
        height: 240px;
        border-radius: 50%;
        border: 40px solid rgba(255, 255, 255, 0.035);
        pointer-events: none;
    }

    .auth-brand-side::after {
        content: "";
        position: absolute;
        right: -100px;
        bottom: -100px;
        width: 240px;
        height: 240px;
        border-radius: 50%;
        background: rgba(24, 181, 207, 0.10);
        pointer-events: none;
    }

/* =========================================================
   Logo
   ========================================================= */

.auth-logo {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    width: 280px;
    max-width: 100%;
    padding: 10px 14px;
    border-radius: 16px;
    background: #ffffff;
    overflow: hidden;
}

.auth-logo-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* =========================================================
   Brand Content
   ========================================================= */

.auth-brand-content {
    position: relative;
    z-index: 2;
    margin-top: auto;
    margin-bottom: auto;
    padding: var(--space-9) 0;
}

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    margin-bottom: var(--space-5);
    padding: var(--space-1) var(--space-3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.82);
    font-size: var(--fs-caption);
    font-weight: var(--fw-semibold);
}

.auth-brand-content h1 {
    max-width: 360px;
    margin: 0;
    color: #ffffff;
    font-size: var(--fs-display);
    font-weight: var(--fw-extrabold);
    line-height: 1.5;
}

    .auth-brand-content h1 span {
        display: block;
        color: var(--dk-cyan);
    }

.auth-brand-content p {
    max-width: 360px;
    margin: var(--space-5) 0 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: var(--fs-small);
    font-weight: 400;
    line-height: var(--lh-readable);
}


/* =========================================================
   Benefits
   ========================================================= */

.auth-benefits {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.auth-benefit {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 36px;
    padding: var(--space-2) var(--space-3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.80);
    font-size: var(--fs-caption);
    font-weight: var(--fw-medium);
}

    .auth-benefit span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 20px;
        color: var(--dk-cyan);
        font-size: var(--fs-small);
    }


/* =========================================================
   Form Side
   ========================================================= */

.auth-form-side {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: var(--space-10) var(--space-9);
}


/* =========================================================
   Form Header
   ========================================================= */

.auth-form-head {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    margin-bottom: var(--space-7);
}

.auth-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--control-min);
    height: var(--control-min);
    flex: 0 0 var(--control-min);
    border: 1px solid var(--dk-border);
    border-radius: 12px;
    background: #ffffff;
    color: var(--dk-text);
    font-size: var(--fs-subtitle);
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

    .auth-back:hover {
        border-color: var(--dk-cyan);
        color: var(--dk-blue);
        background: rgba(24, 181, 207, 0.05);
    }

.auth-step {
    display: block;
    margin-bottom: var(--space-2);
    color: var(--dk-cyan);
    font-size: var(--fs-caption);
    font-weight: var(--fw-bold);
}

.auth-form-head h2 {
    margin: 0;
    color: var(--dk-text);
    font-size: var(--fs-h2);
    font-weight: var(--fw-extrabold);
    line-height: var(--lh-compact);
}

.auth-form-head p {
    margin: var(--space-2) 0 0;
    color: var(--dk-muted);
    font-size: var(--fs-small);
    line-height: var(--lh-normal);
}

.auth-form-head strong {
    color: var(--dk-text);
    font-weight: var(--fw-bold);
}


/* =========================================================
   Form
   ========================================================= */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

    .auth-field > label {
        color: var(--dk-text);
        font-size: var(--fs-small);
        font-weight: var(--fw-semibold);
    }


/* =========================================================
   Text Input
   ========================================================= */

.auth-input-wrap {
    position: relative;
}

    .auth-input-wrap input {
        width: 100%;
        height: var(--control-xl);
        padding: 0 58px 0 var(--space-4);
        direction: ltr;
        outline: none;
        border: 1px solid var(--form-border);
        border-radius: 12px;
        background: #ffffff;
        color: var(--dk-text);
        font-size: var(--fs-body);
        font-weight: var(--fw-medium);
        line-height: var(--lh-compact);
        transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    }

        .auth-input-wrap input::placeholder {
            color: var(--dk-muted);
            font-weight: 400;
        }

        .auth-input-wrap input:hover {
            border-color: var(--form-border-hover);
        }

        .auth-input-wrap input:focus {
            border-color: var(--form-focus);
            box-shadow: 0 0 0 4px var(--form-focus-ring);
        }

.auth-input-icon {
    position: absolute;
    top: 50%;
    right: var(--space-3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 32px;
    padding: 0 var(--space-2);
    transform: translateY(-50%);
    border-radius: 8px;
    background: rgba(24, 181, 207, 0.08);
    color: var(--dk-blue);
    font-size: var(--fs-caption);
    font-weight: var(--fw-bold);
    pointer-events: none;
}


/* =========================================================
   Validation
   ========================================================= */

.auth-validation {
    display: block;
    color: var(--form-error);
    font-size: var(--fs-caption);
    font-weight: var(--fw-medium);
    line-height: var(--lh-normal);
}

    .auth-validation:empty {
        display: none;
    }

.input-validation-error {
    border-color: var(--form-error) !important;
    box-shadow: 0 0 0 4px rgba(180, 35, 59, 0.08) !important;
}

.field-validation-error {
    color: var(--form-error);
}


/* =========================================================
   Main Button
   ========================================================= */

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    min-height: var(--control-xl);
    padding: var(--space-3) var(--space-5);
    cursor: pointer;
    border: 0;
    border-radius: 12px;
    background: var(--dk-blue);
    color: #ffffff;
    font-size: var(--fs-small);
    font-weight: var(--fw-bold);
    line-height: var(--lh-compact);
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

    .auth-submit:hover {
        background: var(--dk-blue-dark);
        box-shadow: 0 8px 18px rgba(23, 52, 110, 0.14);
        transform: translateY(-1px);
    }

    .auth-submit:active {
        transform: translateY(0);
    }

    .auth-submit:disabled {
        cursor: not-allowed;
        background: var(--form-disabled-bg);
        color: var(--form-disabled-text);
        box-shadow: none;
        transform: none;
    }

    .auth-submit span {
        font-size: var(--fs-subtitle);
    }


/* =========================================================
   Return Hint
   ========================================================= */

.auth-return-hint {
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--dk-border);
    border-radius: 10px;
    background: var(--dk-background);
    color: var(--text-muted-accessible);
    font-size: var(--fs-caption);
    line-height: var(--lh-normal);
}


/* =========================================================
   Status Messages
   ========================================================= */

.auth-message {
    margin-bottom: var(--space-5);
    padding: var(--space-3) var(--space-4);
    border-radius: 10px;
    font-size: var(--fs-small);
    font-weight: var(--fw-medium);
    line-height: var(--lh-normal);
}

    .auth-message.is-success {
        color: var(--form-success);
        border: 1px solid rgba(8, 123, 102, 0.18);
        background: var(--form-success-bg);
    }

    .auth-message.is-error {
        color: var(--form-error);
        border: 1px solid rgba(180, 35, 59, 0.18);
        background: var(--form-error-bg);
    }


/* =========================================================
   OTP Inputs
   ========================================================= */

.otp-fields {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--space-2);
    width: 100%;
}

.otp-digit {
    width: 100%;
    min-width: 0;
    height: var(--control-xl);
    padding: 0;
    outline: none;
    border: 1px solid var(--form-border);
    border-radius: 12px;
    background: #ffffff;
    color: var(--dk-text);
    text-align: center;
    font-size: var(--fs-subtitle);
    font-weight: var(--fw-bold);
    caret-color: var(--dk-cyan);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

    .otp-digit:hover {
        border-color: var(--form-border-hover);
    }

    .otp-digit:focus {
        border-color: var(--form-focus);
        background: #ffffff;
        box-shadow: 0 0 0 4px var(--form-focus-ring);
    }


/* =========================================================
   OTP Timer
   ========================================================= */

.otp-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--control-min);
}

.otp-timer {
    color: var(--dk-muted);
    font-size: var(--fs-caption);
    font-weight: var(--fw-medium);
}

    .otp-timer strong {
        display: inline-block;
        min-width: 40px;
        direction: ltr;
        color: var(--dk-blue);
        font-size: var(--fs-small);
        font-weight: var(--fw-bold);
    }


/* =========================================================
   Resend Button
   ========================================================= */

.otp-resend-form {
    display: flex;
    justify-content: center;
    margin-top: var(--space-3);
}

.otp-resend-button {
    min-height: var(--control-min);
    padding: var(--space-2) var(--space-4);
    cursor: pointer;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--dk-blue);
    font-size: var(--fs-small);
    font-weight: var(--fw-semibold);
    transition: color 0.2s ease, background-color 0.2s ease;
}

    .otp-resend-button:not(:disabled):hover {
        color: var(--dk-blue-dark);
        background: rgba(24, 181, 207, 0.07);
    }

    .otp-resend-button:disabled {
        cursor: not-allowed;
        color: var(--form-disabled-text);
    }


    /* =========================================================
   Focus Accessibility
   ========================================================= */

    .auth-back:focus-visible,
    .auth-submit:focus-visible,
    .otp-resend-button:focus-visible {
        outline: 3px solid var(--form-focus-ring);
        outline-offset: 2px;
    }


/* =========================================================
   Tablet
   ========================================================= */

@media (max-width: 1024px) {

    .auth-card {
        grid-template-columns: minmax(280px, 0.8fr) minmax(400px, 1.2fr);
    }

    .auth-brand-side {
        padding: var(--space-7);
    }

    .auth-form-side {
        padding: var(--space-9) var(--space-7);
    }
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 768px) {

    .auth-shell {
        align-items: stretch;
        min-height: 100vh;
        padding: 0;
    }

    .auth-ambient {
        display: none;
    }

    .auth-card {
        display: flex;
        flex-direction: column;
        width: 100%;
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-brand-side {
        min-height: auto;
        padding: var(--space-6) var(--space-5);
        border-radius: 0 0 22px 22px;
    }

    .auth-logo {
        width: 230px;
    }

    .auth-brand-content {
        margin: 0;
        padding: var(--space-7) 0 0;
    }

        .auth-brand-content h1 {
            font-size: var(--fs-section-lg);
        }

            .auth-brand-content h1 span {
                display: inline;
            }

        .auth-brand-content p {
            margin-top: var(--space-3);
        }

    .auth-benefits {
        display: none;
    }

    .auth-form-side {
        flex: 1;
        justify-content: flex-start;
        padding: var(--space-7) var(--space-5) var(--space-8);
    }

    .auth-form-head {
        margin-bottom: var(--space-6);
    }

        .auth-form-head h2 {
            font-size: var(--fs-section);
        }
}


/* =========================================================
   Small Mobile
   ========================================================= */

@media (max-width: 480px) {

    .auth-brand-side {
        padding: var(--space-5) var(--space-4);
    }

    .auth-form-side {
        padding: var(--space-6) var(--space-4) var(--space-8);
    }

    .auth-form-head {
        gap: var(--space-3);
    }

    .otp-fields {
        gap: var(--space-1);
    }

    .otp-digit {
        border-radius: 10px;
        font-size: var(--fs-body);
    }
    .auth-logo {
        width: 205px;
    }
}


/* =========================================================
   Very Small Mobile
   ========================================================= */

@media (max-width: 360px) {

    .auth-form-side {
        padding-right: var(--space-3);
        padding-left: var(--space-3);
    }

    .otp-fields {
        gap: 3px;
    }
}


/* =========================================================
   Reduced Motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .auth-back,
    .auth-submit,
    .otp-digit,
    .otp-resend-button,
    .auth-input-wrap input {
        transition: none;
    }
}
.otp-timer {
    color: #596275;
    font-weight: 600;
}

    .otp-timer strong {
        display: inline-block;
        min-width: 52px;
        color: #d92f4b;
        font-size: 17px;
        font-weight: 900;
        direction: ltr;
        letter-spacing: 1px;
    }
        .otp-timer strong.is-ending {
            color: #c51636;
            font-weight: 900;
            animation: otp-timer-pulse 1s ease-in-out infinite;
        }

@keyframes otp-timer-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}