/* ==========================================================================
   Arabian Star — Sign-in screen
   Designed to feel like a native mobile app: full-bleed on a phone, a phone
   shaped card on a desktop. No external fonts, no build step.
   ========================================================================== */

:root {
    --a-ink: #0f172a;
    --a-ink-2: #475569;
    --a-muted: #94a3b8;
    --a-line: #e6ebf3;
    --a-field: #f7f9fc;
    --a-brand: #0b2338;
    --a-brand-2: #14425c;
    --a-gold: #d4a017;
    --a-gold-dark: #b8860b;
    --a-bad: #e11d48;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body.auth-body {
    margin: 0;
    font-family: "Segoe UI", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    color: var(--a-ink);
    background:
        radial-gradient(900px 460px at 8% -10%, rgba(36, 122, 156, .38), transparent 62%),
        radial-gradient(760px 420px at 100% 108%, rgba(212, 160, 23, .22), transparent 62%),
        linear-gradient(165deg, #071a2b 0%, #0b2338 42%, #10314a 100%);
    display: grid;
    place-items: center;
    padding: 20px;
    min-height: 100dvh;
    position: relative;
    overflow-x: hidden;
}

[dir="rtl"] body.auth-body {
    font-family: "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif;
}

/* Soft light sweep, keeps the background from looking flat */
body.auth-body::before {
    content: "";
    position: fixed;
    inset: -20% -10% auto -10%;
    height: 60vh;
    background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .07), transparent 70%);
    pointer-events: none;
}

/* ---------------------------------------------------------------- The card */

.auth-phone {
    position: relative;
    width: 100%;
    max-width: 404px;
    background: #fff;
    border-radius: 30px;
    padding: 30px 26px 22px;
    box-shadow: 0 40px 90px -40px rgba(3, 12, 22, .85), 0 0 0 1px rgba(255, 255, 255, .06);
    animation: authIn .45s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes authIn {
    from { opacity: 0; transform: translateY(14px) scale(.985); }
    to   { opacity: 1; transform: none; }
}

/* Brand block */
.auth-brand { text-align: center; margin-bottom: 18px; }

.auth-logo {
    width: 78px;
    height: 78px;
    border-radius: 22px;
    object-fit: contain;
    background: #fff;
    padding: 9px;
    border: 1px solid var(--a-line);
    box-shadow: 0 16px 30px -18px rgba(11, 35, 56, .55);
    display: inline-block;
}

.auth-brand .name {
    font-size: 1.18rem;
    font-weight: 720;
    letter-spacing: -.02em;
    margin: 12px 0 2px;
}

.auth-brand .ar {
    font-size: 12px;
    color: var(--a-muted);
    direction: rtl;
    line-height: 1.5;
}

.auth-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fdf6e3;
    color: #a16207;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .13em;
    text-transform: uppercase;
}

/* Heading */
.auth-head { text-align: center; margin-bottom: 18px; }
.auth-head h1 { font-size: 1.16rem; margin: 0 0 3px; letter-spacing: -.02em; }
.auth-head p { margin: 0; font-size: 13px; color: var(--a-muted); }

/* ---------------------------------------------------------------- Inputs */

.auth-field { position: relative; margin-bottom: 12px; }

.auth-field > label {
    display: block;
    font-size: 11.5px;
    font-weight: 650;
    color: var(--a-ink-2);
    letter-spacing: .02em;
    margin-bottom: 6px;
}

.auth-input {
    width: 100%;
    height: 54px;
    border-radius: 16px;
    border: 1.5px solid var(--a-line);
    background: var(--a-field);
    padding: 0 48px;
    font-size: 16px;            /* 16px stops iOS from zooming on focus */
    font-family: inherit;
    color: var(--a-ink);
    transition: border-color .15s, background .15s, box-shadow .15s;
}

.auth-input::placeholder { color: #a9b4c4; }

.auth-input:focus {
    outline: none;
    background: #fff;
    border-color: #1d5c7a;
    box-shadow: 0 0 0 4px rgba(29, 92, 122, .12);
}

.auth-input.is-invalid { border-color: #fda4af; background: #fffafb; }

.auth-ico {
    position: absolute;
    inset-inline-start: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    display: inline-flex;
    pointer-events: none;
}
.auth-ico svg { width: 19px; height: 19px; }

.auth-eye {
    position: absolute;
    inset-inline-end: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.auth-eye:hover { background: #eef2f7; color: #1d5c7a; }
.auth-eye svg { width: 19px; height: 19px; }

.auth-error {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--a-bad);
    margin-top: 5px;
}

/* Remember me + hints */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 4px 0 16px;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--a-ink-2);
    cursor: pointer;
    user-select: none;
}
.auth-check input { width: 17px; height: 17px; accent-color: #1d5c7a; margin: 0; }

.auth-row a { font-size: 12.5px; color: #1d5c7a; text-decoration: none; font-weight: 600; }
.auth-row a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- Button */

.auth-cta {
    width: 100%;
    height: 56px;
    border: 0;
    border-radius: 17px;
    background: linear-gradient(135deg, var(--a-gold-dark), var(--a-gold));
    color: #241a06;
    font-size: 16.5px;
    font-weight: 750;
    font-family: inherit;
    letter-spacing: .01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    cursor: pointer;
    box-shadow: 0 18px 30px -18px rgba(184, 134, 11, .95);
    transition: transform .12s ease, filter .12s ease;
}
.auth-cta:hover { filter: brightness(1.04); }
.auth-cta:active { transform: scale(.985); }
.auth-cta:disabled { opacity: .6; cursor: not-allowed; }
.auth-cta svg { width: 19px; height: 19px; }

/* ---------------------------------------------------------------- Messages */

.auth-alert {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    padding: 12px 13px;
    border-radius: 14px;
    font-size: 12.5px;
    line-height: 1.5;
    margin-bottom: 14px;
}
.auth-alert svg { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 1px; }
.auth-alert.bad { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }
.auth-alert.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }

/* ---------------------------------------------------------------- Footer */

.auth-lang {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--a-line);
}
.auth-lang a {
    padding: 6px 15px;
    border-radius: 999px;
    border: 1px solid var(--a-line);
    font-size: 12px;
    font-weight: 650;
    color: var(--a-ink-2);
    text-decoration: none;
    transition: .15s;
}
.auth-lang a:hover { border-color: #cbd5e1; background: var(--a-field); }
.auth-lang a.active { background: var(--a-brand); border-color: var(--a-brand); color: #fff; }

.auth-foot {
    text-align: center;
    font-size: 10.5px;
    color: #a9b4c4;
    margin-top: 14px;
    line-height: 1.7;
}
.auth-foot strong { color: var(--a-gold-dark); }

/* Install / security hint */
.auth-note {
    display: flex;
    gap: 9px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 13px;
    background: var(--a-field);
    border: 1px solid var(--a-line);
    font-size: 11.5px;
    color: var(--a-ink-2);
    margin-bottom: 16px;
}
.auth-note svg { width: 16px; height: 16px; flex: 0 0 16px; color: #1d5c7a; }

/* Development shortcuts */
.auth-dev {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--a-line);
}
.auth-dev summary {
    cursor: pointer;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--a-muted);
    font-weight: 700;
    list-style: none;
    text-align: center;
}
.auth-dev summary::-webkit-details-marker { display: none; }
.auth-dev .row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 9px; }
.auth-dev button {
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid var(--a-line);
    background: var(--a-field);
    color: var(--a-ink-2);
    cursor: pointer;
    font-family: inherit;
}
.auth-dev button:hover { background: #eef2f7; }

/* ==========================================================================
   Phone: edge-to-edge sheet, like a native app
   ========================================================================== */

@media (max-width: 520px) {
    body.auth-body {
        padding: 0;
        display: block;
        background: #fff;
    }

    /* The gradient lives behind a short hero band at the top instead */
    body.auth-body::before {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: 210px;
        border-radius: 0 0 30px 30px;
        background:
            radial-gradient(600px 260px at 12% -30%, rgba(36, 122, 156, .5), transparent 65%),
            radial-gradient(520px 240px at 100% 120%, rgba(212, 160, 23, .3), transparent 65%),
            linear-gradient(160deg, #071a2b, #0d2c44 60%, #124055);
        display: block;
    }

    .auth-phone {
        max-width: none;
        min-height: 100dvh;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        padding:
            calc(env(safe-area-inset-top, 0px) + 26px)
            20px
            calc(env(safe-area-inset-bottom, 0px) + 20px);
        display: flex;
        flex-direction: column;
        animation: none;
    }

    /* White sheet that slides over the hero band */
    .auth-sheet {
        margin-top: 132px;
        background: #fff;
        border-radius: 26px;
        padding: 22px 18px 18px;
        box-shadow: 0 24px 50px -30px rgba(3, 12, 22, .55);
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .auth-brand { margin-bottom: 14px; }

    .auth-logo {
        width: 66px;
        height: 66px;
        border-radius: 19px;
        box-shadow: 0 18px 34px -16px rgba(3, 12, 22, .7);
        position: relative;
        z-index: 1;
    }

    .auth-brand .name { color: #fff; margin-top: 10px; }
    .auth-brand .ar { color: rgba(219, 231, 240, .72); }
    .auth-tag { background: rgba(212, 160, 23, .18); color: #ffe9a8; }

    .auth-head { text-align: start; margin-bottom: 16px; }
    .auth-head h1 { font-size: 1.22rem; }
    .auth-head p { font-size: 12.5px; }

    .auth-input { height: 56px; font-size: 16px; }
    .auth-cta { height: 58px; }

    .auth-lang { margin-top: auto; }
}

/* Very small phones */
@media (max-width: 360px) {
    .auth-head h1 { font-size: 1.1rem; }
    .auth-input { height: 52px; }
}

/* Landscape phones: avoid the hero eating the screen */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
    body.auth-body { display: grid; place-items: center; background: var(--a-brand); padding: 12px; }
    body.auth-body::before { display: none; }
    .auth-phone { max-width: 460px; min-height: 0; background: #fff; border-radius: 20px; padding: 18px; }
    .auth-sheet { margin: 0; padding: 0; box-shadow: none; background: transparent; }
    .auth-brand, .auth-head { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-phone { animation: none; }
}
