/* Anga brand shell for the customer-facing UAE PASS journey.
 *
 * Three screens make up one hand-off from WhatsApp and back:
 *   /proceedtosignin -> UAE PASS -> /oauth -> /uaesuccess
 * plus the pre-circuit splash in App.razor. They have to read as one product,
 * so the black ground, the Omar avatar, the white card and the motion live here
 * rather than being pasted into each page.
 *
 * Tokens are prefixed --anga-* on purpose: UAESuccess.razor still carries its own
 * :root block with bare names (--black, --yellow...), and prefixing keeps the two
 * from colliding while that page keeps its shipped, verified styling.
 */

:root {
    --anga-black: #0a0a0a;
    --anga-yellow: #FCFF5A;
    --anga-white: #ffffff;
    --anga-grey-100: #f7f7f5;
    --anga-grey-400: #9a9a9a;
    --anga-green: #22c55e;
    --anga-card-radius: 24px;
    --anga-avatar-size: 130px;
}

/* ── PAGE SHELL ──
   Fills the viewport edge to edge. These pages opt out of MainLayout (see
   FullScreenLayout.razor), so there is no article padding to fight. */
.anga-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--anga-black);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 40px;
    position: relative;
    overflow-x: hidden;
}

.anga-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle at 20% 80%, rgba(252, 255, 90, 0.06) 0%, transparent 50%),
                      radial-gradient(circle at 80% 10%, rgba(34, 197, 94, 0.04) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

.anga-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── ANGA LOGO ── */
.anga-logo {
    margin-bottom: 32px;
    animation: angaFadeDown 0.5s ease-out both;
}

.anga-logo img {
    height: 28px;
    width: auto;
    display: block;
    /* Anga_Logo.png is a pure-black wordmark on transparency, so on this black
       ground it renders as nothing at all. Inverting paints it white and keeps
       the antialiased edges, rather than shipping a second colourway of the asset.
       Applies to /uaesuccess too, where the wordmark is currently invisible. */
    filter: invert(1);
}

/* ── OMAR AVATAR ── */
.anga-avatar {
    position: relative;
    width: var(--anga-avatar-size);
    height: var(--anga-avatar-size);
    margin-bottom: -55px; /* overlaps the card below */
    z-index: 10;
    animation: angaFadeDown 0.55s ease-out 0.05s both;
}

.anga-avatar img {
    width: var(--anga-avatar-size);
    height: var(--anga-avatar-size);
    border-radius: 50%;
    display: block;
    border: 3px solid var(--anga-black);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 3px var(--anga-yellow);
}

.anga-avatar-dot {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 14px;
    height: 14px;
    background: #2ecc71;
    border-radius: 50%;
    border: 2px solid var(--anga-black);
}

/* ── CARD ── */
.anga-card {
    width: 100%;
    background: var(--anga-white);
    border-radius: var(--anga-card-radius);
    padding: 64px 36px 48px;
    text-align: center;
    animation: angaFadeUp 0.6s ease-out 0.1s both;
    position: relative;
    overflow: hidden;
}

.anga-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--anga-yellow);
}

.anga-eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--anga-grey-400);
    margin-bottom: 18px;
}

.anga-title {
    font-family: 'Rubik', 'Inter', sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: var(--anga-black);
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.anga-subtitle {
    font-size: 14px;
    color: #555;
    line-height: 1.65;
    margin-bottom: 40px;
    font-weight: 400;
}

/* ── UAE PASS BUTTON ── */
.anga-uaepass-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    width: 100%;
    display: flex;
    justify-content: center;
}

.anga-uaepass-button:hover {
    transform: translateY(-2px);
    opacity: 0.92;
}

.anga-uaepass-button:active {
    transform: translateY(0);
}

.anga-uaepass-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.anga-uaepass-button img {
    width: 260px;
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── PRIVACY NOTE ── */
.anga-privacy {
    font-size: 11px;
    color: var(--anga-grey-400);
    margin-top: 32px;
    line-height: 1.6;
}

.anga-privacy a {
    color: var(--anga-black);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── SPINNER / LOADING ── */
.anga-loading {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.anga-loading-text {
    color: #888;
    font-size: 13px;
}

.anga-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #e5e5e5;
    border-top: 2px solid var(--anga-black);
    border-radius: 50%;
    animation: angaSpin 0.8s linear infinite;
    flex-shrink: 0;
}

.anga-spinner-lg {
    width: 34px;
    height: 34px;
    border-width: 3px;
    border-top-width: 3px;
}

/* ── STATUS BANNERS ── */
.anga-error {
    background-color: #fff0f0;
    border: 1px solid #ffd0d0;
    color: #c0392b;
    padding: 12px;
    border-radius: 10px;
    margin-top: 16px;
    font-size: 13px;
    line-height: 1.55;
}

.anga-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    padding: 12px;
    border-radius: 10px;
    margin-top: 16px;
    font-size: 13px;
    line-height: 1.55;
}

/* Green "verification complete" pill, matching the one on /uaesuccess. */
.anga-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 100px;
    margin-bottom: 20px;
    animation: angaPopIn 0.4s ease-out both;
}

.anga-badge-dot {
    width: 6px;
    height: 6px;
    background: var(--anga-green);
    border-radius: 50%;
    animation: angaPulse 2s ease-in-out infinite;
}

/* ── FOOTER ── */
.anga-footer {
    margin-top: 24px;
    font-size: 11px;
    color: rgba(255,255,255,0.25);
    text-align: center;
    animation: angaFadeUp 0.7s ease-out 0.2s both;
}

/* ── ANIMATIONS ── */
@keyframes angaFadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes angaFadeDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes angaPopIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes angaPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

@keyframes angaSpin {
    to { transform: rotate(360deg); }
}

/* ── DESKTOP UPLIFT ── */
@media (min-width: 480px) {
    .anga-card {
        padding: 72px 48px 52px;
    }

    .anga-title {
        font-size: 30px;
    }

    .anga-uaepass-button img {
        width: 280px;
    }
}

/* Short viewports - an SE-class phone inside the WhatsApp in-app browser is only
   ~560px tall. Tighten the vertical rhythm so the CTA stays above the fold.
   Mirrors the breakpoints already shipped on /uaesuccess. */
@media (max-height: 700px) {
    :root {
        --anga-avatar-size: 104px;
    }

    .anga-logo {
        margin-bottom: 20px;
    }

    .anga-logo img {
        height: 24px;
    }

    .anga-avatar {
        margin-bottom: -44px;
    }

    .anga-card {
        padding: 52px 28px 32px;
    }

    .anga-eyebrow {
        margin-bottom: 12px;
    }

    .anga-title {
        font-size: 22px;
        margin-bottom: 14px;
    }

    .anga-subtitle {
        margin-bottom: 24px;
    }

    .anga-privacy {
        margin-top: 20px;
    }

    .anga-footer {
        margin-top: 16px;
    }
}

/* Very short viewports. Nothing decorative fits, so drop the logo and avatar
   rather than push the CTA off-screen. */
@media (max-height: 520px) {
    .anga-logo,
    .anga-avatar {
        display: none;
    }

    .anga-card {
        padding: 32px 24px 28px;
    }

    .anga-title {
        font-size: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .anga-logo,
    .anga-avatar,
    .anga-card,
    .anga-footer,
    .anga-badge {
        animation: none;
    }

    .anga-badge-dot {
        animation: none;
    }
}
