:root {
    --blue-1: #365b96;
    --blue-2: #264372;
    --blue-3: #172b52;
    --gold: #f9d838;
    --green-1: #10b981;
    --green-2: #059669;
    --white-90: rgba(255, 255, 255, .90);
    --white-75: rgba(255, 255, 255, .75);
    --white-16: rgba(255, 255, 255, .16);
    --white-10: rgba(255, 255, 255, .10);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

@font-face {
    font-family: 'Cairo';
    src: url('../fonts/cairo-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Cairo';
    src: url('../fonts/cairo-semibold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    color: #ffffff;
    font-family: "Cairo", Tahoma, Arial, sans-serif;
    background: radial-gradient(circle at 50% 0%, rgba(63, 106, 185, .28), transparent 42%), linear-gradient(180deg, #e8f0ff 0%, #cdddf6 100%);
}

body {
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

form {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ================================
   Start Page
   ================================ */

.start-page {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    padding: calc(14px + env(safe-area-inset-top, 0px)) clamp(14px, 4vw, 26px) calc(14px + env(safe-area-inset-bottom, 0px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at 18% 22%, rgba(14, 165, 233, .16), transparent 32%), radial-gradient(circle at 86% 78%, rgba(16, 185, 129, .15), transparent 36%), radial-gradient(circle at 50% -8%, rgba(249, 216, 56, .20), transparent 34%), linear-gradient(180deg, var(--blue-1) 0%, var(--blue-2) 46%, var(--blue-3) 100%);
}

    .start-page::before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        opacity: .50;
        background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, .10) 18%, transparent 38%), linear-gradient(240deg, transparent 0%, rgba(255, 255, 255, .06) 22%, transparent 45%);
    }

/* ================================
   Animated Background Orbs
   ================================ */

.bg-orb {
    opacity: .55;
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    animation-name: orbFloat;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

.orb-1 {
    width: clamp(150px, 44vw, 240px);
    height: clamp(150px, 44vw, 240px);
    right: -88px;
    top: 70px;
    background: rgba(249, 216, 56, .12);
    border: 1px solid rgba(249, 216, 56, .12);
    animation-duration: 10s;
}

.orb-2 {
    width: clamp(150px, 42vw, 220px);
    height: clamp(150px, 42vw, 220px);
    left: -96px;
    top: 44%;
    background: rgba(14, 165, 233, .15);
    border: 1px solid rgba(14, 165, 233, .12);
    animation-duration: 13s;
    animation-delay: -3s;
}

.orb-3 {
    width: clamp(210px, 64vw, 310px);
    height: clamp(210px, 64vw, 310px);
    right: -126px;
    bottom: -100px;
    background: rgba(16, 185, 129, .13);
    border: 1px solid rgba(16, 185, 129, .10);
    animation-duration: 16s;
    animation-delay: -6s;
}

@keyframes orbFloat {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(22px, -28px, 0) scale(1.07);
    }

    100% {
        transform: translate3d(-20px, 24px, 0) scale(1.10);
    }
}

.orb-1 {
    animation-duration: 8s;
}

.orb-2 {
    animation-duration: 10s;
}

.orb-3 {
    animation-duration: 12s;
}

/* ================================
   Layout Layers
   ================================ */

.start-header,
.start-main,
.start-action,
.start-footer {
    position: relative;
    z-index: 2;
}

/* ================================
   Header
   ================================ */

.start-header {
    width: min(100%, 520px);
    min-height: clamp(44px, 6vh, 56px);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.brand-logo {
    width: clamp(38px, 9vw, 46px);
    height: clamp(38px, 9vw, 46px);
    border-radius: 15px;
    overflow: hidden;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, .18);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .14);
}

    .brand-logo img,
    .main-logo-box img {
        display: block;
        pointer-events: none;
    }

    .brand-logo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.brand-title {
    display: block;
    color: #ffffff;
    font-size: clamp(13px, 3.4vw, 15px);
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
}

.brand-subtitle {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, .76);
    font-size: clamp(10px, 2.6vw, 11px);
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

.top-pill {
    height: clamp(32px, 4.8vh, 38px);
    padding: 0 clamp(10px, 3vw, 13px);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--gold);
    font-size: clamp(11px, 2.9vw, 12.5px);
    font-weight: 600;
    white-space: nowrap;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(249, 216, 56, .25);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 8px 18px rgba(0, 0, 0, .12);
}

.sound-toggle-btn {
    width: clamp(32px, 4.8vh, 38px);
    height: clamp(32px, 4.8vh, 38px);
    border: 1px solid rgba(249, 216, 56, .25);
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: clamp(13px, 3.2vw, 15px);
    background: rgba(255, 255, 255, .14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 8px 18px rgba(0, 0, 0, .12);
    transition: transform .12s ease, filter .12s ease, background .12s ease, color .12s ease;
}

    .sound-toggle-btn:active {
        transform: scale(.94);
        filter: brightness(.96);
    }

    .sound-toggle-btn.is-muted {
        color: rgba(255, 255, 255, .65);
        background: rgba(255, 255, 255, .09);
        border-color: rgba(255, 255, 255, .16);
    }

/* ================================
   Main Content
   ================================ */

.start-main {
    width: min(100%, 520px);
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: clamp(18px, 4vh, 38px) 0;
}

.main-logo-box {
    width: clamp(86px, 20vw, 118px);
    height: clamp(86px, 20vw, 118px);
    margin: 0 auto clamp(14px, 2.2vh, 20px);
    border-radius: clamp(24px, 6vw, 32px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    box-shadow: 0 14px 26px rgba(0, 0, 0, .15), 0 0 0 7px rgba(255, 255, 255, .07);
}

    .main-logo-box img {
        max-width: 78%;
        max-height: 78%;
        object-fit: contain;
    }

.start-badge {
    width: max-content;
    max-width: min(330px, 94%);
    margin: 0 auto clamp(9px, 1.4vh, 13px);
    padding: 7px 14px;
    border-radius: 999px;
    color: var(--gold);
    font-size: clamp(11px, 3vw, 13px);
    font-weight: 600;
    line-height: 1.2;
    background: rgba(249, 216, 56, .14);
    border: 1px solid rgba(249, 216, 56, .24);
}

.main-title {
    margin: 0;
    color: #ffffff;
    font-size: clamp(31px, 8.3vw, 46px);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -.35px;
    text-shadow: 0 3px 10px rgba(0, 0, 0, .20);
}

.sub-title {
    margin: clamp(7px, 1.1vh, 10px) 0 0;
    color: rgba(255, 255, 255, .94);
    font-size: clamp(15px, 4vw, 20px);
    font-weight: 600;
    line-height: 1.4;
}

.mini-text {
    width: min(355px, 94%);
    margin: clamp(10px, 1.8vh, 16px) auto 0;
    color: rgba(255, 255, 255, .84);
    font-size: clamp(12px, 3.2vw, 14px);
    font-weight: 600;
    line-height: 1.7;
}

/* ================================
   Info Boxes
   ================================ */

.info-row {
    width: min(355px, 94%);
    margin-top: clamp(16px, 2.6vh, 24px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.info-box {
    min-height: clamp(58px, 8vh, 72px);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .07));
    border: 1px solid rgba(255, 255, 255, .13);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
}

    .info-box strong {
        color: #ffffff;
        font-size: clamp(20px, 5vw, 25px);
        font-weight: 600;
        line-height: 1;
    }

    .info-box span {
        margin-top: 5px;
        color: rgba(255, 255, 255, .74);
        font-size: clamp(10px, 2.7vw, 12px);
        font-weight: 600;
        line-height: 1.2;
    }

/* ================================
   Help Cards
   ================================ */

.help-list {
    width: min(355px, 94%);
    margin-top: clamp(14px, 2.3vh, 22px);
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
}

.help-card {
    min-height: clamp(46px, 6.5vh, 56px);
    padding: 0 clamp(11px, 3.2vw, 15px);
    border-radius: 21px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .08));
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 9px 18px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .10);
}

.help-icon {
    width: clamp(32px, 8vw, 38px);
    height: clamp(32px, 8vw, 38px);
    flex: 0 0 clamp(32px, 8vw, 38px);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--blue-3);
    background: #ffffff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, .12);
    font-size: clamp(12px, 3.2vw, 15px);
}

.help-card.gold .help-icon {
    background: var(--gold);
    color: #473b00;
}

.help-card.green .help-icon {
    background: #6ee7b7;
    color: #064e3b;
}

.help-text {
    min-width: 0;
    text-align: right;
}

    .help-text strong {
        display: block;
        color: #ffffff;
        font-size: clamp(12px, 3.2vw, 14px);
        font-weight: 600;
        line-height: 1.35;
    }

    .help-text span {
        display: block;
        margin-top: 1px;
        color: rgba(255, 255, 255, .75);
        font-size: clamp(10px, 2.7vw, 11.5px);
        font-weight: 400;
        line-height: 1.35;
    }

/* ================================
   Start Button
   ================================ */

.start-action {
    width: min(100%, 520px);
    margin: 0 auto;
    padding-top: 4px;
}

.start-button {
    width: 100%;
    height: clamp(54px, 7.4vh, 64px);
    border: 0;
    border-radius: clamp(19px, 5vw, 24px);
    cursor: pointer;
    color: #ffffff;
    font-family: "Cairo", Tahoma, Arial, sans-serif;
    font-size: clamp(17px, 4.5vw, 21px);
    font-weight: 600;
    line-height: 1;
    background: linear-gradient(180deg, rgba(255, 255, 255, .24), transparent 42%), linear-gradient(135deg, var(--green-1) 0%, var(--green-2) 100%);
    box-shadow: 0 13px 22px rgba(5, 150, 105, .26), 0 8px 18px rgba(0, 0, 0, .17), inset 0 1px 0 rgba(255, 255, 255, .25);
    text-shadow: 0 2px 4px rgba(0, 0, 0, .22);
    -webkit-appearance: none;
    appearance: none;
    transition: transform .12s ease, filter .12s ease, opacity .12s ease;
}

    .start-button:active {
        transform: scale(.975);
        filter: brightness(.97);
    }

    .start-button.is-submitting {
        pointer-events: none;
        opacity: .86;
        filter: saturate(.9);
    }

/* ================================
   Footer
   ================================ */

.start-footer {
    width: min(100%, 520px);
    margin: 9px auto 0;
    text-align: center;
    color: rgba(255, 255, 255, .70);
    font-size: clamp(10px, 2.5vw, 11px);
    font-weight: 600;
    line-height: 1.55;
}

    .start-footer span {
        color: var(--gold);
    }

/* ================================
   Loader
   ================================ */

.global-loader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 13px;
    background: rgba(26, 48, 91, .82);
}

    .global-loader.active {
        display: flex;
    }

.spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, .24);
    border-top-color: #ffffff;
    animation: spinLoader .75s linear infinite;
}

.loader-text {
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
}

@keyframes spinLoader {
    to {
        transform: rotate(360deg);
    }
}

/* ================================
   Welcome Modal
   ================================ */

.welcome-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(23, 43, 82, .45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s ease, visibility .22s ease;
}

    .welcome-modal.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

.welcome-modal-box {
    width: min(92%, 330px);
    padding: 24px 20px 20px;
    border-radius: 26px;
    text-align: center;
    contain: layout paint;
    background: linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .08)), linear-gradient(145deg, var(--blue-1) 0%, var(--blue-2) 55%, var(--blue-3) 100%);
    border: 1px solid rgba(255, 255, 255, .18);
    box-shadow: 0 24px 55px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .20);
    transform: translateY(12px) scale(.96);
    transition: transform .22s ease;
}

.welcome-modal.active .welcome-modal-box {
    transform: translateY(0) scale(1);
}

.welcome-modal-logo {
    width: 94px;
    height: 94px;
    margin: 0 auto 14px;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    box-shadow: 0 14px 28px rgba(0, 0, 0, .18), 0 0 0 6px rgba(255, 255, 255, .08);
    overflow: hidden;
}

    .welcome-modal-logo img {
        width: 78%;
        height: 78%;
        object-fit: contain;
        display: block;
        pointer-events: none;
    }

.welcome-modal-title {
    margin-bottom: 18px;
    color: #ffffff;
    font-size: clamp(19px, 5vw, 24px);
    font-weight: 600;
    line-height: 1.7;
    text-shadow: 0 3px 10px rgba(0, 0, 0, .20);
}

.welcome-modal-btn {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 18px;
    cursor: pointer;
    color: #ffffff;
    font-family: "Cairo", Tahoma, Arial, sans-serif;
    font-size: 17px;
    font-weight: 600;
    background: linear-gradient(180deg, rgba(255, 255, 255, .24), transparent 42%), linear-gradient(135deg, var(--green-1) 0%, var(--green-2) 100%);
    box-shadow: 0 10px 20px rgba(5, 150, 105, .25), inset 0 1px 0 rgba(255, 255, 255, .25);
    transition: transform .12s ease, filter .12s ease;
}

    .welcome-modal-btn:active {
        transform: scale(.975);
        filter: brightness(.96);
    }

/* ================================
   Responsive
   ================================ */

@media (min-width: 760px) {
    .help-list {
        width: min(520px, 94%);
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mini-text,
    .info-row {
        width: min(430px, 94%);
    }
}

@media (max-height: 700px) {
    .start-page {
        padding-top: calc(10px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }

    .start-main {
        padding: 14px 0;
    }

    .main-logo-box {
        width: 74px;
        height: 74px;
        margin-bottom: 10px;
        border-radius: 23px;
    }

    .main-title {
        font-size: clamp(27px, 7.2vw, 36px);
    }

    .sub-title {
        font-size: clamp(13px, 3.6vw, 17px);
    }

    .mini-text {
        margin-top: 7px;
        line-height: 1.45;
    }

    .info-row {
        margin-top: 10px;
    }

    .info-box {
        min-height: 52px;
    }

    .help-list {
        margin-top: 10px;
        gap: 7px;
    }

    .help-card {
        min-height: 43px;
    }

    .help-text span {
        display: none;
    }

    .start-button {
        height: 50px;
    }
}

@media (max-height: 610px) {
    .start-badge,
    .info-row,
    .mini-text {
        display: none;
    }

    .help-list {
        margin-top: 12px;
    }

    .main-logo-box {
        width: 64px;
        height: 64px;
    }
}

/* ================================
   Reduced Motion
   ================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }

    .bg-orb {
        animation: none !important;
        transform: none !important;
    }
}
/* إصلاح نهائي: جعل الدوائر خلف عناصر الصفحة */
.start-page {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

    /* الدوائر خلف المحتوى */
    .start-page > .bg-orb {
        z-index: 0 !important;
        pointer-events: none !important;
    }

/* كل محتوى الصفحة فوق الدوائر */
.start-header,
.start-main,
.start-action,
.start-footer {
    position: relative;
    z-index: 2 !important;
}

/* منع ظهور الدوائر بوضوح داخل كروت المعلومات */
.info-box {
    position: relative;
    z-index: 3 !important;
    background: linear-gradient(180deg, rgba(74, 101, 145, .98), rgba(48, 72, 113, .98)) !important;
}

/* نفس الفكرة لكروت وسائل المساعدة */
.help-card {
    position: relative;
    z-index: 3 !important;
    background: linear-gradient(180deg, rgba(65, 90, 133, .98), rgba(43, 67, 108, .98)) !important;
}
