/* =====================================================================
   City2Day — شاشات الحساب بتصميم تطبيق (دخول · حساب جديد · تفعيل · استعادة)
   موبايل: صورة الرياض فوق + لوحة بيضا طالعة من تحت (Bottom sheet)
   ديسكتوب: اللوحة يمين والصورة بطول الشاشة شمال
   ===================================================================== */
:root {
    --primary-color: #1E3C96;
    --secondary-color: #1EA5F0;
    --text-color: #16213D;
    --bg-color: #FFFFFF;

    --aa-navy: #0F1F5C;
    --aa-slate: #5D6B8A;
    --aa-line: #DCE6F5;
    --aa-field: #F6F9FE;
    --aa-tint: #EBF3FD;
    --aa-danger: #D92D3A;
    --aa-success: #0E9488;
    --aa-radius: 16px;
    --aa-sheet-radius: 30px;
    --aa-ease: cubic-bezier(.2, .8, .2, 1);
    --aa-font: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
}

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

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

body.aa-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--aa-font);
    color: var(--text-color);
    background: var(--aa-navy);
    -webkit-tap-highlight-color: transparent;
    overflow-x: clip;
}

.aa-body a { color: var(--primary-color); }

.aa-body :focus-visible {
    outline: 3px solid rgba(30, 165, 240, .5);
    outline-offset: 2px;
}

.aa {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
}

/* ---------------- الجزء العلوي (الصورة) ---------------- */
.aa-hero {
    position: relative;
    flex: none;
    min-height: 272px;
    height: 36svh;
    padding: max(16px, env(safe-area-inset-top)) 20px 50px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    overflow: hidden;
    isolation: isolate;
}

.aa-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background: #0F1F5C url('../img/auth-journey.jpg') center 30% / cover no-repeat;
    transform: scale(1.08);
    animation: aa-kenburns 14s ease-out both;
}

.aa-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(120% 70% at 85% 0%, rgba(30, 165, 240, .35), transparent 60%),
        linear-gradient(180deg, rgba(15, 31, 92, .12) 0%, rgba(15, 31, 92, .3) 45%, rgba(15, 31, 92, .92) 100%);
}

@keyframes aa-kenburns {
    from { transform: scale(1.16); }
    to { transform: scale(1.04); }
}

.aa-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.aa-back {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    text-decoration: none;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    font-size: 1.15rem;
    transition: background-color .2s ease;
}

.aa-back:hover { background: rgba(255, 255, 255, .26); }

.aa-logo { height: 26px; width: auto; display: block; }

.aa-hero-text { animation: aa-fade-up .7s var(--aa-ease) .1s both; }

.aa-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .25);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    font-size: .76rem;
    font-weight: 700;
}

.aa-pill i { color: #9EDBFF; }

.aa-hero h1 {
    margin: 10px 0 4px;
    font-size: clamp(1.75rem, 7.4vw, 2.3rem);
    line-height: 1.3;
    font-weight: 900;
    letter-spacing: -.3px;
}

.aa-hero p {
    margin: 0;
    max-width: 420px;
    color: rgba(255, 255, 255, .82);
    font-size: .95rem;
    line-height: 1.7;
}

/* ---------------- اللوحة البيضا ---------------- */
.aa-sheet {
    position: relative;
    z-index: 2;
    flex: 1;
    margin-top: -30px;
    padding: 12px 20px max(28px, env(safe-area-inset-bottom));
    background: #fff;
    border-radius: var(--aa-sheet-radius) var(--aa-sheet-radius) 0 0;
    box-shadow: 0 -18px 40px rgba(15, 31, 92, .22);
    animation: aa-sheet-in .65s var(--aa-ease) both;
}

.aa-sheet::before {
    content: "";
    display: block;
    width: 42px;
    height: 5px;
    margin: 0 auto 18px;
    border-radius: 5px;
    background: #D7E0EE;
}

.aa-inner { width: 100%; max-width: 440px; margin: 0 auto; }

@keyframes aa-sheet-in {
    from { transform: translateY(60px); opacity: 0; }
    to { transform: none; opacity: 1; }
}

@keyframes aa-fade-up {
    from { transform: translateY(14px); opacity: 0; }
    to { transform: none; opacity: 1; }
}

/* عناصر اللوحة بتدخل ورا بعض */
.aa-stagger > * { animation: aa-fade-up .55s var(--aa-ease) both; }
.aa-stagger > *:nth-child(1) { animation-delay: .12s; }
.aa-stagger > *:nth-child(2) { animation-delay: .17s; }
.aa-stagger > *:nth-child(3) { animation-delay: .22s; }
.aa-stagger > *:nth-child(4) { animation-delay: .27s; }
.aa-stagger > *:nth-child(5) { animation-delay: .32s; }
.aa-stagger > *:nth-child(6) { animation-delay: .37s; }
.aa-stagger > *:nth-child(7) { animation-delay: .42s; }
.aa-stagger > *:nth-child(8) { animation-delay: .47s; }
.aa-stagger > *:nth-child(9) { animation-delay: .52s; }
.aa-stagger > *:nth-child(n+10) { animation-delay: .56s; }

/* تبويب دخول / حساب جديد */
.aa-seg {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 5px;
    margin-bottom: 22px;
    border-radius: 16px;
    background: #F0F4FA;
}

.aa-seg a {
    position: relative;
    z-index: 1;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: var(--aa-slate);
    font-weight: 800;
    font-size: .95rem;
    text-decoration: none;
    transition: color .2s ease;
}

.aa-seg a.on {
    color: var(--aa-navy);
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 31, 92, .12);
}

.aa-title {
    margin: 0 0 4px;
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--aa-navy);
}

.aa-sub { margin: 0 0 20px; color: var(--aa-slate); font-size: .92rem; }

/* رسائل السيرفر (lblMessage / lblMsg) */
.aa-msgbox > span:empty { display: none; }

.aa-msgbox > .text-danger,
.aa-msgbox > .text-success {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.6;
    animation: aa-shake .45s ease both;
}

.aa-msgbox > .text-danger { background: #FDECEE; color: var(--aa-danger); border: 1px solid #F7C9CE; }
.aa-msgbox > .text-success { background: #E6F7F5; color: var(--aa-success); border: 1px solid #B6E6E0; animation-name: aa-fade-up; }
.aa-msgbox a { color: inherit; font-weight: 800; }

.aa-msgbox > .text-danger::before,
.aa-msgbox > .text-success::before {
    content: "!";
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--aa-danger);
    color: #fff;
    font-size: .8rem;
    font-weight: 900;
}

.aa-msgbox > .text-success::before { content: "✓"; background: var(--aa-success); }

@keyframes aa-shake {
    0%, 100% { transform: none; }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(3px); }
}

/* ---------------- الحقول (Label عائم) ---------------- */
.aa-field {
    position: relative;
    display: flex;
    align-items: center;
    height: 60px;
    margin-bottom: 14px;
    border-radius: var(--aa-radius);
    background: var(--aa-field);
    border: 1.5px solid var(--aa-line);
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.aa-field:focus-within {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(30, 60, 150, .1);
}

.aa-field.is-bad { border-color: var(--aa-danger); box-shadow: 0 0 0 4px rgba(217, 45, 58, .08); }
.aa-field.is-good { border-color: var(--aa-success); }

.aa-field > i {
    flex: none;
    width: 48px;
    text-align: center;
    font-size: 1.15rem;
    color: #8A97B4;
    transition: color .2s ease;
}

.aa-field:focus-within > i { color: var(--primary-color); }

.aa-field input:focus,
.aa-field input:focus-visible { outline: none; }

.aa-field input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 20px 0 4px;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
}

.aa-field input[dir="ltr"] { text-align: right; }
.aa-field input[dir="ltr"]:not(:placeholder-shown) { text-align: left; }

.aa-field label {
    position: absolute;
    inset-inline-start: 48px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    color: #8A97B4;
    font-size: .95rem;
    font-weight: 600;
    pointer-events: none;
    transform-origin: right center;
    transition: top .18s ease, transform .18s ease, color .18s ease, font-size .18s ease;
}

.aa-field input:focus + label,
.aa-field input:not(:placeholder-shown) + label {
    top: 15px;
    transform: none;
    font-size: .74rem;
    color: var(--aa-slate);
}

.aa-field input::placeholder { color: transparent; }
.aa-field input:focus::placeholder { color: #B6C1D6; }

.aa-eye {
    flex: none;
    width: 48px;
    height: 100%;
    border: 0;
    background: transparent;
    color: #8A97B4;
    font-size: 1.15rem;
    cursor: pointer;
}

.aa-eye:hover { color: var(--primary-color); }

.aa-row-end { display: flex; justify-content: flex-end; margin: -4px 0 18px; }

.aa-link {
    font-size: .88rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--primary-color);
}

.aa-link:hover { text-decoration: underline; }

/* قوة كلمة المرور */
.aa-meter { display: flex; gap: 5px; margin: -6px 4px 6px; }
.aa-meter i { flex: 1; height: 4px; border-radius: 4px; background: #E3E9F3; transition: background-color .25s ease; }
.aa-meter-txt { margin: 0 4px 14px; font-size: .78rem; font-weight: 700; color: var(--aa-slate); min-height: 1.2em; }
.aa-meter[data-s="1"] i:nth-child(-n+1) { background: #E5484D; }
.aa-meter[data-s="2"] i:nth-child(-n+2) { background: #F5A623; }
.aa-meter[data-s="3"] i:nth-child(-n+3) { background: #1EA5F0; }
.aa-meter[data-s="4"] i:nth-child(-n+4) { background: #0E9488; }

/* ---------------- الزر الرئيسي ---------------- */
.aa-btn-wrap {
    position: relative;
    display: block;
    margin-top: 6px;
}

.aa-btn-wrap .aa-btn {
    width: 100%;
    height: 58px;
    border: 0;
    border-radius: var(--aa-radius);
    background: linear-gradient(135deg, var(--primary-color) 0%, #2350B8 55%, var(--secondary-color) 130%);
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(30, 60, 150, .32);
    transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.aa-btn-wrap .aa-btn:hover { filter: brightness(1.06); box-shadow: 0 16px 30px rgba(30, 60, 150, .38); }
.aa-btn-wrap .aa-btn:active { transform: scale(.985); }

/* السهم جوه الزر (asp:Button ما ينفعش يحتوي أيقونة) */
.aa-btn-wrap::after {
    content: "";
    position: absolute;
    left: 24px;
    top: 50%;
    width: 10px;
    height: 10px;
    margin-top: -5px;
    border-top: 2.5px solid #fff;
    border-left: 2.5px solid #fff;
    transform: rotate(-45deg);
    pointer-events: none;
    transition: transform .2s ease;
}

.aa-btn-wrap:hover::after { transform: translateX(-3px) rotate(-45deg); }

.aa-btn-wrap.is-loading .aa-btn { color: transparent; pointer-events: none; }
.aa-btn-wrap.is-loading::after {
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    transform: none;
    animation: aa-spin .7s linear infinite;
}

@keyframes aa-spin { to { transform: rotate(360deg); } }

.aa-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 16px;
    color: #9AA6BF;
    font-size: .82rem;
    font-weight: 700;
}

.aa-or::before, .aa-or::after { content: ""; flex: 1; height: 1px; background: var(--aa-line); }

/* بطاقة «صاحب فندق؟» */
.aa-card-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: var(--aa-radius);
    border: 1.5px solid var(--aa-line);
    text-decoration: none;
    color: var(--text-color) !important;
    transition: border-color .2s ease, transform .2s ease, background-color .2s ease;
}

.aa-card-link:hover { border-color: var(--secondary-color); background: #F7FBFF; transform: translateY(-1px); }

.aa-card-ic {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--aa-tint);
    color: var(--primary-color);
    font-size: 1.2rem;
}

.aa-card-link b { display: block; font-size: .95rem; color: var(--aa-navy); }
.aa-card-link small { display: block; color: var(--aa-slate); font-size: .8rem; }
.aa-card-link .bi-chevron-left { margin-inline-start: auto; color: #9AA6BF; }

.aa-foot {
    margin-top: 18px;
    text-align: center;
    font-size: .8rem;
    color: #8A97B4;
    line-height: 1.8;
}

.aa-foot a { color: var(--aa-slate); font-weight: 700; }

.aa-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    font-size: .78rem;
    font-weight: 700;
    color: #8A97B4;
}

.aa-secure i { color: var(--aa-success); }

/* مصيدة البوتات — مخفية عن الزائر */
.c2d-hp {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    inset-inline-start: 0;
    opacity: 0;
    pointer-events: none;
}

/* ---------------- رمز التفعيل (6 خانات) ---------------- */
.aa-mail {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--aa-tint);
    color: var(--aa-navy);
    font-weight: 800;
    font-size: .9rem;
    direction: ltr;
}

.aa-otp {
    position: relative;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 18px;
    direction: ltr;
}

.aa-otp span {
    height: 60px;
    border-radius: 14px;
    border: 1.5px solid var(--aa-line);
    background: var(--aa-field);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--aa-navy);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background-color .15s ease;
}

.aa-otp span.filled { background: #fff; transform: translateY(-2px); }

.aa-otp.focus span.cur {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(30, 60, 150, .1);
    background: #fff;
}

.aa-otp.focus span.cur:empty::after {
    content: "";
    width: 2px;
    height: 26px;
    background: var(--primary-color);
    animation: aa-caret 1s steps(2) infinite;
}

@keyframes aa-caret { 50% { opacity: 0; } }

.aa-otp input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: .01;
    border: 0;
    font-size: 16px;
    color: transparent;
    caret-color: transparent;
    background: transparent;
    letter-spacing: 40px;
}

/* بدون JavaScript: الحقل الحقيقي يظهر */
.no-js .aa-otp span { display: none; }
.no-js .aa-otp { display: block; }
.no-js .aa-otp input {
    position: static;
    opacity: 1;
    height: 60px;
    border: 1.5px solid var(--aa-line);
    border-radius: 14px;
    color: var(--aa-navy);
    text-align: center;
    letter-spacing: 10px;
    font-weight: 900;
}

.aa-resend {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.aa-resend a { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; text-decoration: none; }

.aa-note {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #F6F9FE;
    color: var(--aa-slate);
    font-size: .82rem;
    line-height: 1.8;
}

.aa-icon-hero {
    width: 64px;
    height: 64px;
    margin-bottom: 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    font-size: 1.8rem;
}

/* ---------------- الشاشات الكبيرة ---------------- */
@media (min-width: 992px) {
    body.aa-body { background: #F3F6FB; }

    .aa {
        display: grid;
        grid-template-columns: minmax(460px, 1fr) minmax(0, 1.05fr);
        min-height: 100vh;
    }

    .aa-hero {
        order: 2;
        height: auto;
        min-height: 100vh;
        margin: 14px;
        border-radius: 32px;
        padding: 34px 40px 44px;
        position: sticky;
        top: 14px;
        max-height: calc(100vh - 28px);
        min-height: calc(100vh - 28px);
    }

    .aa-hero::before { background-position: center 30%; }

    .aa-hero::after {
        background:
            radial-gradient(90% 60% at 80% 0%, rgba(30, 165, 240, .3), transparent 60%),
            linear-gradient(180deg, rgba(15, 31, 92, .15) 0%, rgba(15, 31, 92, .35) 50%, rgba(15, 31, 92, .92) 100%);
    }

    .aa-hero h1 { font-size: clamp(2.2rem, 3.4vw, 3.2rem); }
    .aa-hero p { font-size: 1.05rem; }

    .aa-services { display: flex !important; }

    .aa-sheet {
        order: 1;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 40px 48px;
    }

    .aa-sheet::before { display: none; }

    .aa-inner {
        padding: 36px 34px 30px;
        border-radius: 28px;
        background: #fff;
        box-shadow: 0 24px 60px rgba(15, 31, 92, .1);
        border: 1px solid #E6EDF7;
    }
}

/* شارات الخدمات (ديسكتوب فقط) */
.aa-services {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.aa-services span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    font-size: .82rem;
    font-weight: 700;
}

/* ---------------- جوه تطبيق المدينة اليوم ----------------
   التطبيق فيه شريط علوي وزر رجوع، فبنشيل صف الرجوع واللوجو ونصغّر الصورة */
html[data-c2d-app] .aa-top { display: none; }
html[data-c2d-app] .aa-hero { min-height: 210px; height: 27svh; padding-top: 18px; }
html[data-c2d-app] .aa-hero h1 { font-size: 1.7rem; }

@media (prefers-reduced-motion: reduce) {
    .aa-hero::before,
    .aa-hero-text,
    .aa-sheet,
    .aa-stagger > *,
    .aa-msgbox > span { animation: none !important; }
    .aa-otp.focus span.cur:empty::after { animation: none; }
}

/* حقول ASP.NET المخفية جوه الفورم ما تاخدش مكان في التخطيط */
.aa > .aspNetHidden { display: none; }
