/*
 * Sign-in pages (login, forgot password, verification code, new password).
 * Mobile first: one column, a navy brand band and a white sheet under it.
 * From 900px up the band becomes a side panel and the sheet a centred card.
 * Colours are the Drovox identity tokens also used by drovox-ui.css.
 */

:root {
    --au-navy: #01153E;
    --au-sky: #29AAE2;
    --au-link: #0A6E9E;
    --au-ground: #F4F6FA;
    --au-line: #D5DBE7;
    --au-text: #0B1B3F;
    --au-muted: #5B6680;
    --au-on-navy: #C9D3E6;
    --au-danger: #C62F36;
    --au-danger-tint: #FDECEC;
    --au-success: #0B7A55;
    --au-success-tint: #E3F5EE;
}

*, *::before, *::after { box-sizing: border-box; }

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

body.au {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--au-navy);
    color: var(--au-text);
    font-family: 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

/* ---------- brand band ---------- */

.au-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: calc(20px + env(safe-area-inset-top)) 20px 48px;
}

.au-logo { display: block; height: 28px; width: auto; }

.au-lang {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
}

.au-intro { display: none; }

/* ---------- watermark: the Drovox X as a thin outline, its four dots faint ---------- */

.au-wm .x { fill: none; stroke: rgba(255, 255, 255, .16); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.au-wm .d1 { fill: #817BD6; }
.au-wm .d2 { fill: #BD77FF; }
.au-wm .d3 { fill: #29AAE2; }
.au-wm .d4 { fill: #7AD5FF; }
.au-wm .d1, .au-wm .d2, .au-wm .d3, .au-wm .d4 { opacity: .35; }

/* Phone band: only a corner of the X shows, peeking in behind the language button. */
.au-brand { position: relative; overflow: hidden; isolation: isolate; }

.au-wm {
    display: block;
    position: absolute;
    z-index: -1;
    top: -70px;
    inset-inline-end: -70px;
    width: 220px;
    height: 220px;
    pointer-events: none;
}

/* ---------- sheet ---------- */

.au-sheet {
    position: relative; /* paint over the band's positioned watermark where the two overlap */
    flex: 1;
    margin-top: -24px;
    padding: 28px 20px calc(28px + env(safe-area-inset-bottom));
    background: #fff;
    border-radius: 24px 24px 0 0;
}

.au-box { width: 100%; max-width: 400px; margin: 0 auto; }

.au-title {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--au-navy);
}

.au-sub { margin: 0 0 24px; color: var(--au-muted); font-size: 15px; }

.au-sub bdi { color: var(--au-text); font-weight: 700; }

/* ---------- messages ---------- */

.au-alert {
    margin: 0 0 20px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
}

.au-alert--error { background: var(--au-danger-tint); color: var(--au-danger); }
.au-alert--success { background: var(--au-success-tint); color: var(--au-success); }
.au-alert ul { margin: 0; padding: 0; list-style: none; }

/* ---------- fields ---------- */

.au-field { margin-bottom: 18px; }

.au-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--au-text);
}

.au-input {
    display: block;
    width: 100%;
    height: 52px;
    padding: 0 14px;
    border: 1.5px solid var(--au-line);
    border-radius: 14px;
    background: #fff;
    color: var(--au-text);
    font: inherit;
    font-size: 16px; /* below 16px iOS zooms the page on focus */
    -webkit-appearance: none;
    appearance: none;
}

.au-input::placeholder { color: #9AA3B8; }

.au-input:focus {
    outline: none;
    border-color: var(--au-sky);
    box-shadow: 0 0 0 3px rgba(41, 170, 226, .25);
}

.au-hint { margin: 6px 0 0; font-size: 13px; color: var(--au-muted); }

.au-password { position: relative; }
.au-password .au-input { padding-inline-end: 84px; }

.au-toggle {
    position: absolute;
    top: 4px;
    inset-inline-end: 4px;
    height: 44px;
    min-width: 72px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--au-link);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

/* ---------- verification code ---------- */

.au-otp {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    direction: ltr;
}

.au-otp .au-input {
    flex: 1 1 0;
    max-width: 68px;
    height: 64px;
    padding: 0;
    text-align: center;
    font-size: 26px;
    font-weight: 700;
}

/* ---------- actions ---------- */

.au-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    margin-top: 6px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: var(--au-navy);
    color: #fff;
    font: inherit;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
}

.au-btn[disabled] { opacity: .6; cursor: default; }

.au-btn:focus-visible,
.au-toggle:focus-visible,
.au-link:focus-visible,
.au-lang:focus-visible {
    outline: 3px solid var(--au-sky);
    outline-offset: 2px;
}

.au-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 12px;
}

.au-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 8px;
    color: var(--au-link);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.au-link[aria-disabled="true"] { color: var(--au-muted); pointer-events: none; }

/* ---------- 900px and up: side panel + card ---------- */

@media (min-width: 900px) {
    body.au { flex-direction: row; }

    /* Brand panel: content centred over a large outlined X that bleeds off the edges. */
    .au-brand {
        position: relative;
        overflow: hidden;
        isolation: isolate;
        flex: 0 0 42%;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0;
        padding: 64px 48px 120px;
        text-align: center;
        background: radial-gradient(ellipse at 50% 45%, #0A2463 0%, var(--au-navy) 62%);
    }

    .au-wm {
        inset-inline-end: auto; /* before left: in RTL this is the left side */
        top: 50%;
        left: 50%;
        width: 104vh;
        height: 104vh;
        transform: translate(-50%, -50%);
        pointer-events: none;
    }

    .au-logo { width: 260px; height: auto; }

    .au-lang {
        position: absolute;
        bottom: 40px;
        left: 50%;
        transform: translateX(-50%);
    }

    .au-intro { display: block; max-width: 420px; margin-top: 44px; color: var(--au-on-navy); }
    .au-intro h2 { margin: 0; color: #fff; font-size: 30px; font-weight: 700; }

    .au-sheet {
        display: flex;
        align-items: center;
        margin: 0;
        padding: 48px;
        border-radius: 0;
        background: var(--au-ground);
    }

    .au-box {
        max-width: 440px;
        padding: 40px;
        border-radius: 24px;
        background: #fff;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .au-input { transition: border-color .12s ease, box-shadow .12s ease; }
}
