/* ============================================================
   AstroVidya — "Temple Dawn" Sophisticated Light Theme
   Mobile-first, Indian mass market, Kurosawa composition
   ============================================================ */

/* --- Design Tokens ---------------------------------------- */

:root {
    /* Page & surface — DARK NAVY */
    --bg-page: #0F172A;
    --bg-card: #1E293B;
    --bg-warm: #1E1B4B;
    --bg-hero: linear-gradient(135deg, #1E1B4B 0%, #312E81 50%, #1E1B4B 100%);
    --bg-gradient: linear-gradient(180deg, #0F172A, #1E1B4B);

    /* Text — LIGHT ON DARK */
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --text-warm: #F5E6D3;

    /* Accent — WARM GOLD */
    --accent: #F59E0B;
    --accent-light: #FBBF24;
    --accent-gradient: linear-gradient(135deg, #F59E0B, #FBBF24);

    /* Borders — DARK SLATE */
    --border: #334155;
    --border-emphasis: #475569;

    /* Semantic */
    --success: #059669;
    --success-light: #10B981;
    --error: #DC2626;
    --error-light: #EF4444;
    --purple: #7C3AED;

    /* Indigo — header & hero */
    --indigo: #312E81;
    --indigo-deep: #1E1B4B;

    /* Effects */
    --gold-glow: rgba(245, 158, 11, 0.15);
    --surface-hover: #334155;

    /* System */
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* --- Reset & Base ----------------------------------------- */

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

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

body {
    font-family: 'Inter', 'Noto Sans Devanagari', system-ui, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
    overscroll-behavior: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

/* Hindi/Indic text font priority */
[lang="hi"] body, .hindi-text {
    font-family: 'Noto Sans Devanagari', 'Inter', system-ui, sans-serif;
}
[lang="pa"] body {
    font-family: 'Noto Sans Gurmukhi', 'Inter', system-ui, sans-serif;
}
[lang="ml"] body {
    font-family: 'Noto Sans Malayalam', 'Inter', system-ui, sans-serif;
}

#app {
    position: relative;
    z-index: 1;
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
}

/* ---- Tablet: 600-767px — wider mobile frame ---- */
@media (min-width: 600px) and (max-width: 767px) {
    body {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        background: #0B1120;
    }
    #app {
        max-width: 540px;
        width: 540px;
        min-height: 100vh;
        background: var(--bg-page);
        box-shadow: 0 0 60px rgba(0, 0, 0, 0.3);
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
        overflow: hidden;
        position: relative;
    }
    header#header { max-width: 540px; }
    .bottom-nav  { max-width: 540px; }
    .chat-input-bar { max-width: 540px; }
}

/* ---- Desktop: full-width two-column layout ---- */
@media (min-width: 768px) {
    :root {
        --desktop-sidebar: 240px;
    }
    body {
        background: #0B1120;
    }
    #app {
        max-width: 1200px;
        width: 100%;
        min-height: 100vh;
        margin: 0 auto;
        display: grid;
        grid-template-columns: var(--desktop-sidebar) 1fr 320px;
        grid-template-rows: auto 1fr;
        background: var(--bg-page);
    }

    /* Header spans full width */
    header#header {
        grid-column: 1 / -1;
        position: sticky;
        top: 0;
        left: 0;
        transform: none;
        max-width: none;
        width: 100%;
        border-radius: 0;
    }

    /* Bottom nav becomes left sidebar — LIGHT */
    .bottom-nav {
        grid-column: 1 !important;
        grid-row: 2 !important;
        position: sticky !important;
        top: 52px !important;
        height: calc(100vh - 52px) !important;
        width: var(--desktop-sidebar) !important;
        max-width: none !important;
        left: auto !important;
        bottom: auto !important;
        transform: none !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        gap: 4px !important;
        padding: 20px 12px !important;
        border-top: none !important;
        border-right: 1px solid var(--border) !important;
        background: var(--bg-card) !important;
        backdrop-filter: none !important;
        z-index: 40;
        overflow-y: auto;
    }

    .nav-item {
        flex-direction: row;
        gap: 12px;
        padding: 12px 16px;
        border-radius: 12px;
        font-size: 14px;
        justify-content: flex-start;
        min-width: auto;
    }
    .nav-item.active {
        background: rgba(245, 158, 11, 0.08);
    }
    .nav-item span {
        font-size: 14px;
    }

    /* All views sit in the right column */
    [id^="view-"] {
        grid-column: 2;
        grid-row: 2;
        max-width: none;
        padding-top: 16px !important;
        padding-bottom: 32px !important;
    }
    /* Chat column 3 — persistent sidebar */
    #view-chat {
        grid-column: 3 !important;
        grid-row: 2 !important;
        display: flex !important;
        flex-direction: column !important;
        position: sticky !important;
        top: 52px !important;
        height: calc(100vh - 52px) !important;
        padding: 0 !important;
        background: var(--bg-card) !important;
        border-left: 1px solid var(--border) !important;
        overflow: hidden;
    }

    #view-chat #chat-messages {
        flex: 1;
        overflow-y: auto;
        padding: 16px;
        max-height: none !important;
    }

    #view-chat .chat-input-bar {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
        max-width: none !important;
        width: 100% !important;
        border-top: 1px solid var(--border);
    }

    #view-chat .chat-overlay-header {
        display: flex !important;
    }
    /* Hide close button on desktop — sidebar is permanent */
    #view-chat .chat-overlay-close {
        display: none;
    }

    /* Views that hide sidebar — span full width for centering */
    #view-splash, #view-onboarding, #view-loading, #view-paywall, #view-hooks {
        grid-column: 1 / -1;
        padding-top: 60px !important;
    }

    /* Onboarding: let app container go wider so dark bg fills viewport */
    body[data-current-view="onboarding"] #app,
    body[data-current-view="splash"] #app,
    body[data-current-view="loading"] #app {
        max-width: 100%;
        background: transparent;
    }

    /* Chat input bar on desktop — positioned in content column */
    .chat-input-bar {
        position: fixed;
        bottom: 0;
        left: calc(50% + calc(var(--desktop-sidebar) / 2));
        transform: translateX(-50%);
        max-width: calc(min(1100px, 100vw) - var(--desktop-sidebar) - 32px);
        width: calc(min(1100px, 100vw) - var(--desktop-sidebar) - 32px);
    }

    /* FAB is mobile-only */
    .chat-fab {
        display: none !important;
    }

    /* Toast on desktop */
    #toast {
        left: calc(50% + calc(var(--desktop-sidebar) / 2));
        bottom: 80px;
    }
}

/* --- Scrollbar -------------------------------------------- */

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-emphasis); border-radius: 3px; }
* { scrollbar-width: thin; scrollbar-color: var(--border-emphasis) transparent; }

.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* --- Light Input Overrides (Chrome autofill) -------------- */

input[type="date"], input[type="time"], input[type="text"], input[type="search"] {
    color-scheme: dark;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0 1000px var(--bg-card) inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* --- Animations ------------------------------------------- */

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes float-gentle {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-6px) scale(1.03); }
}

@keyframes spin-slow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse-dot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes hook-card-enter {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse-red {
    0%, 100% { color: var(--error); }
    50% { color: var(--error-light); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes dot-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

@keyframes score-ring-fill {
    from { stroke-dashoffset: 440; }
}

@keyframes count-fade {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes btn-shine {
    0%   { transform: translateX(-120%) skewX(-20deg); }
    100% { transform: translateX(250%) skewX(-20deg); }
}

@keyframes btn-ripple {
    0%   { transform: scale(0); opacity: 0.5; }
    100% { transform: scale(4); opacity: 0; }
}

@keyframes progress-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.4); }
    100% { transform: scale(1); }
}

@keyframes card-appear {
    0%   { opacity: 0; transform: translateY(28px) scale(0.95); }
    60%  { opacity: 1; transform: translateY(-3px) scale(1.01); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes result-flash-green {
    0%   { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
    30%  { box-shadow: 0 0 40px 10px rgba(5, 150, 105, 0.15); }
    100% { box-shadow: 0 0 16px 0 rgba(5, 150, 105, 0.06); }
}

@keyframes result-flash-red {
    0%   { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
    30%  { box-shadow: 0 0 40px 10px rgba(220, 38, 38, 0.15); }
    100% { box-shadow: 0 0 16px 0 rgba(220, 38, 38, 0.04); }
}

@keyframes orbit-ring {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes skip-btn-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes counter-badge-pop {
    0%   { transform: scale(0.7); opacity: 0; }
    70%  { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.animate-float { animation: float 3s ease-in-out infinite; }
.animate-float-gentle { animation: float-gentle 3s ease-in-out infinite; }
.loading-spinner { /* animation applied to .loading-star-svg inside */ }
.loading-dot { animation: pulse-dot 1.4s ease-in-out infinite; }
.animate-fade-in { animation: fade-in 0.3s ease-out; }
.animate-slide-up { animation: slide-up 0.4s ease-out; }
.animate-hook-enter { animation: hook-card-enter 0.5s cubic-bezier(0.16, 1, 0.3, 1); }

/* --- SVG Icon Utilities ----------------------------------- */

.astro-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.astro-icon svg {
    width: 1em;
    height: 1em;
}

.brand-sparkle-large {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}
.brand-sparkle-large svg {
    filter: none;
}

.gender-icon {
    display: inline;
    vertical-align: middle;
    margin-right: 2px;
}

.btn-sparkle {
    display: inline;
    vertical-align: middle;
    margin-left: 4px;
}

.gender-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.event-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: var(--accent);
    flex-shrink: 0;
}
.event-icon svg {
    width: 22px;
    height: 22px;
}

.btn-verify svg,
.btn-deny svg {
    display: inline;
    vertical-align: middle;
    margin-right: 2px;
}

.reading-category svg {
    display: inline;
    vertical-align: middle;
    color: var(--accent);
}

.astro-primary-btn svg {
    display: inline;
    vertical-align: middle;
}

/* --- View Transitions ------------------------------------- */

[id^="view-"].view-entering {
    animation: view-fade-in 0.25s ease-out;
}

@keyframes view-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Header — Deep Indigo (the "night sky" moment) -------- */

header#header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    z-index: 50;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

@media (min-width: 600px) and (max-width: 767px) {
    header#header {
        max-width: 540px;
    }
}

header .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

header .logo-section {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

header .logo-icon {
    display: inline-flex;
    align-items: center;
    color: var(--accent-light);
}
header .logo-icon svg {
    width: 20px;
    height: 20px;
}

header .logo-text {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #F59E0B, #FBBF24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header .header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Timer */
#timer {
    font-variant-numeric: tabular-nums;
    min-width: 56px;
    text-align: center;
    font-size: 13px;
    font-family: 'Inter', monospace;
    padding: 4px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

#timer.timer-warning {
    border-color: var(--error);
    color: #FCA5A5;
    animation: pulse-red 1s ease-in-out infinite;
}

#timer.timer-ok {
    border-color: var(--success);
    color: #6EE7B7;
}

/* Language selector — styled for dark header */
#lang-toggle {
    font-size: 12px;
    padding: 5px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    cursor: pointer;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    min-height: 32px;
}

#lang-toggle:focus {
    border-color: var(--accent-light);
    outline: none;
}

#lang-toggle option {
    background: var(--indigo);
    color: #FFFFFF;
}

@media (min-width: 768px) {
    #lang-toggle {
        font-size: 13px;
        padding: 6px 12px;
        min-height: 36px;
    }
}

/* Hide old header nav buttons (replaced by bottom nav) */
#nav-kundli, #nav-horoscope {
    display: none !important;
}

/* --- Bottom Navigation — Light ----------------------------- */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 6px 0 calc(6px + var(--safe-bottom));
    z-index: 50;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 20px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: color 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    min-height: 44px;
    min-width: 64px;
}

.nav-item svg { transition: color 0.2s; }

.nav-item.active {
    color: var(--accent);
}

.nav-item:active {
    transform: scale(0.95);
}

/* --- Onboarding Form -------------------------------------- */

#view-onboarding {
    min-height: 100vh;
    padding: 60px 16px 24px;
    /* display: flex + align/justify handled by Tailwind classes in HTML.
       DO NOT set display here — ID specificity overrides .hidden { display: none }. */
}

.ap-form-shell {
    width: 100%;
    max-width: 420px;
    padding: 28px 20px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-card);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.ap-form-shell .text-center { text-align: center; }
.ap-form-shell .space-y-2 > * + * { margin-top: 8px; }
.ap-form-shell .space-y-6 > * + * { margin-top: 24px; }

.astro-field {
    margin-bottom: 4px;
}

.astro-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--text-secondary);
}

.astro-label::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-gradient);
}

.astro-input-shell {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 14px;
    border: 1.5px solid var(--border-emphasis);
    background: var(--bg-card);
    padding: 14px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 50px;
}

.astro-input-shell:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.08);
}

.astro-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--text-muted);
}
.astro-input-icon svg {
    width: 18px;
    height: 18px;
}
.astro-input-shell:focus-within .astro-input-icon {
    color: var(--accent);
}

.astro-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.4;
    padding: 0;
}

.astro-input::placeholder {
    color: var(--text-muted);
}

/* Gender radio buttons */
.gender-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1.5px solid var(--border-emphasis);
    background: var(--bg-card);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    min-height: 50px;
    font-size: 15px;
    color: var(--text-primary);
}

.gender-option:has(input:checked) {
    border-color: var(--accent);
    background: rgba(245, 158, 11, 0.06);
}

.gender-option input[type="radio"] {
    accent-color: var(--accent);
}

/* Primary CTA button */
.astro-primary-btn {
    width: 100%;
    border: none;
    border-radius: 14px;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    padding: 16px 24px;
    background: var(--accent-gradient);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
    cursor: pointer;
    letter-spacing: 0.01em;
    min-height: 52px;
}

.astro-primary-btn:hover {
    filter: brightness(1.06);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
}

.astro-primary-btn:active {
    transform: scale(0.97);
}

.astro-primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- Loading View ----------------------------------------- */

#view-loading {
    padding-top: 60px;
    min-height: 100vh;
    /* display: flex + align/justify handled by Tailwind classes in HTML.
       DO NOT set display here — ID specificity overrides .hidden { display: none }. */
}

#view-loading .loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}
.loading-star-svg {
    animation: spin-slow 2s linear infinite;
}

.loading-step-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    transition: all 0.4s ease;
    font-size: 14px;
}

.loading-step-row.step-active { color: var(--accent); }
.loading-step-row.step-done { color: var(--success); }
.loading-step-row.step-pending { color: var(--text-muted); }

.loading-step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-emphasis);
    flex-shrink: 0;
    transition: all 0.4s ease;
}

.loading-step-dot.dot-active {
    background: var(--accent);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
    animation: dot-pulse 1.2s ease-in-out infinite;
}

.loading-step-dot.dot-done {
    background: var(--success);
    box-shadow: 0 0 4px rgba(5, 150, 105, 0.3);
}

.loading-step-check {
    color: var(--success);
    font-size: 14px;
    font-weight: 700;
    width: 8px;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

/* --- Chat View -------------------------------------------- */

#view-chat {
    padding-top: 60px;
    padding-bottom: 80px;
    min-height: 100vh;
}

#chat-messages {
    padding: 16px;
    overflow-y: auto;
}

/* Chat bubbles — dark theme */
.msg-bubble {
    max-width: 82%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.6;
    animation: fade-in 0.25s ease-out;
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin-bottom: 6px;
}

.msg-user {
    margin-left: auto;
    background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(251,191,36,0.08));
    color: var(--text-primary);
    border-radius: 18px 18px 4px 18px;
}

.msg-assistant {
    margin-right: auto;
    background: var(--bg-card);
    color: var(--text-warm);
    border: 1px solid var(--border);
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.msg-system {
    margin: 4px auto;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    text-align: center;
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 20px;
    max-width: 90%;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 12px 16px;
}

.typing-indicator .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse-dot 1.4s ease-in-out infinite;
}

.typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }

/* Quick action chips */
.quick-chip {
    white-space: nowrap;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.2s;
    cursor: pointer;
    min-height: 40px;
}

.quick-chip:hover, .quick-chip:active {
    border-color: var(--accent);
    color: var(--accent);
    background: transparent;
}

/* Chat input bar — dark */
.chat-input-bar {
    position: fixed;
    bottom: 56px; /* above bottom nav */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 10px 12px calc(10px + var(--safe-bottom));
    z-index: 40;
}

.astro-chat-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.astro-chat-input-shell {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 24px;
    padding: 12px 16px;
    border: 1.5px solid var(--border-emphasis);
    background: var(--bg-card);
    min-height: 48px;
    transition: border-color 0.2s;
}

.astro-chat-input-shell:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.06);
}

.astro-chat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
    color: var(--accent);
}
.astro-chat-icon svg {
    width: 16px;
    height: 16px;
}

.astro-chat-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.4;
    padding: 0;
}

.astro-chat-input::placeholder {
    color: var(--text-muted);
}

.astro-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    color: #FFFFFF;
    background: var(--accent-gradient);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: transform 0.12s, filter 0.12s;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
    flex-shrink: 0;
    cursor: pointer;
}

.astro-send-btn:hover { filter: brightness(1.06); }
.astro-send-btn:active { transform: scale(0.93); }

input[type="date"]::-webkit-inner-spin-button,
input[type="time"]::-webkit-inner-spin-button {
    opacity: 0;
    position: absolute;
    left: -9999px;
}

/* --- Kundli View ------------------------------------------ */

#view-kundli, #view-horoscope, #view-hooks, #view-reading {
    padding-top: 60px;
    padding-bottom: calc(72px + var(--safe-bottom));
}

.kundli-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.kundli-chart-wrapper {
    text-align: center;
}

.chart-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 480px) {
    .kundli-charts-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .chart-title {
        font-size: 11px;
    }
}

@media (max-width: 340px) {
    .kundli-charts-grid {
        grid-template-columns: 1fr;
    }
}

/* Compact cells in multi-chart grid */
.kundli-charts-grid .kundli-cell {
    padding: 3px;
    font-size: 8px;
}
.kundli-charts-grid .kundli-cell .cell-sign {
    font-size: 6px;
}
.kundli-charts-grid .kundli-cell .cell-planets {
    font-size: 8px;
}
.kundli-charts-grid .kundli-center-label {
    gap: 1px;
}
.kundli-charts-grid .kundli-center-label .chart-name {
    font-size: 9px;
}
.kundli-charts-grid .kundli-center-label .chart-type {
    font-size: 6px;
}

@media (min-width: 480px) {
    .kundli-charts-grid .kundli-cell {
        padding: 5px;
        font-size: 9px;
    }
    .kundli-charts-grid .kundli-cell .cell-sign {
        font-size: 7px;
    }
    .kundli-charts-grid .kundli-cell .cell-planets {
        font-size: 9px;
    }
    .kundli-charts-grid .kundli-center-label .chart-name {
        font-size: 11px;
    }
}

.kundli-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    border: 2px solid var(--accent);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
}

.kundli-cell {
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px;
    position: relative;
    min-height: 0;
    font-size: 10px;
    line-height: 1.2;
}

.kundli-cell .cell-sign {
    position: absolute;
    top: 3px;
    left: 4px;
    font-size: 7px;
    color: var(--text-muted);
    font-weight: 500;
}

.kundli-cell .cell-planets {
    font-size: 10px;
    color: var(--accent);
    text-align: center;
    font-weight: 600;
    line-height: 1.3;
}

.kundli-center {
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kundli-center-label {
    grid-column: 2 / 4;
    grid-row: 2 / 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 1px solid var(--border);
    background: rgba(245, 158, 11, 0.03);
}

.kundli-center-label .chart-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
}

.kundli-center-label .chart-type {
    font-size: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.kundli-cell.has-asc .cell-sign {
    color: var(--accent);
    font-weight: 700;
}

.kundli-cell.has-asc::after {
    content: '';
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
}

.planet-retro { color: var(--error) !important; }

@media (min-width: 380px) {
    .kundli-cell { font-size: 11px; padding: 8px; }
    .kundli-cell .cell-sign { font-size: 8px; }
    .kundli-cell .cell-planets { font-size: 11px; }
    .kundli-center-label .chart-name { font-size: 14px; }
}

/* --- Kundli Hero Summary ---------------------------------- */

.kundli-hero {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.kundli-hero-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.kundli-hero-sep {
    color: var(--text-muted);
}

.kundli-hero-rashi {
    color: var(--accent);
    font-weight: 500;
}

.kundli-hero-dasha {
    color: var(--text-secondary);
    font-size: 14px;
}

/* --- Compact Chart ---------------------------------------- */

.chart-compact {
    text-align: center;
}

.chart-expand-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.chart-expand-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.chart-expand-toggle.expanded svg {
    transform: rotate(180deg);
}

.chart-grid-expanded {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 500px;
    margin: 0 auto;
    animation: slide-up 0.3s ease-out;
}

@media (max-width: 380px) {
    .chart-grid-expanded {
        grid-template-columns: 1fr;
    }
}

/* --- Life Area Cards -------------------------------------- */

.life-area-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.life-area-card:hover {
    box-shadow: 0 0 20px var(--gold-glow);
}

.life-area-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    cursor: pointer;
    user-select: none;
}

.life-area-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent);
    flex-shrink: 0;
}

.life-area-icon svg {
    width: 20px;
    height: 20px;
}

.life-area-title {
    flex: 1;
}

.life-area-title-hi {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.life-area-title-en {
    font-size: 12px;
    color: var(--text-muted);
}

.life-area-expand-icon {
    color: var(--text-muted);
    transition: transform 0.2s;
}

.life-area-card.expanded .life-area-expand-icon {
    transform: rotate(180deg);
}

.life-area-summary {
    padding: 0 16px 12px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-warm);
}

.life-area-planets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 12px;
}

.planet-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 12px;
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
}

.life-area-yogas {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 12px;
}

.yoga-tag {
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 11px;
    color: var(--text-secondary);
}

.life-area-detail {
    padding: 0 16px 16px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 12px;
    display: none;
}

.life-area-card.expanded .life-area-detail {
    display: block;
    animation: slide-up 0.3s ease-out;
}

/* --- Ask Guru CTA ----------------------------------------- */

.ask-guru-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: 14px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.ask-guru-btn:hover {
    background: rgba(245, 158, 11, 0.08);
}

/* --- Planets Table ---------------------------------------- */

#kundli-planets table { border-collapse: collapse; }

#kundli-planets tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

#kundli-planets tbody tr:hover {
    background: var(--bg-warm);
}

.planet-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.planet-icon { font-size: 14px; }

.status-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.status-exalted {
    background: rgba(5, 150, 105, 0.08);
    color: var(--success);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.status-debilitated {
    background: rgba(220, 38, 38, 0.06);
    color: var(--error);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.status-retrograde {
    background: rgba(124, 58, 237, 0.06);
    color: var(--purple);
    border: 1px solid rgba(124, 58, 237, 0.2);
}

.status-combust {
    background: rgba(245, 158, 11, 0.08);
    color: #B45309;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* --- Yoga Cards ------------------------------------------- */

.yoga-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    animation: fade-in 0.3s ease-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.yoga-card .yoga-name {
    font-weight: 600;
    color: var(--accent);
    font-size: 15px;
}

.yoga-card .yoga-type {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.yoga-card .yoga-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.5;
}

.yoga-strength-bar {
    height: 3px;
    border-radius: 2px;
    background: var(--border);
    margin-top: 10px;
    overflow: hidden;
}

.yoga-strength-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--accent-gradient);
    transition: width 0.5s ease-out;
}

/* --- Dasha Rows ------------------------------------------- */

.dasha-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.dasha-row.dasha-active {
    border-color: var(--accent);
    background: rgba(245, 158, 11, 0.04);
}

.dasha-planet {
    font-weight: 600;
    color: var(--accent);
    min-width: 52px;
}

.dasha-dates {
    color: var(--text-secondary);
    font-size: 13px;
    flex: 1;
}

.dasha-badge {
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.06);
    color: var(--accent);
    border: 1px solid rgba(245, 158, 11, 0.2);
    font-weight: 500;
}

/* --- Horoscope Cards -------------------------------------- */

.horoscope-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    animation: slide-up 0.4s ease-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.horoscope-card .area-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-right: 10px;
    color: var(--accent);
    flex-shrink: 0;
}
.horoscope-card .area-icon svg {
    width: 20px;
    height: 20px;
}

.horoscope-card .area-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.horoscope-card .area-prediction {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.6;
}

/* --- Skeleton / Shimmer ----------------------------------- */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-warm) 25%,
        var(--border) 50%,
        var(--bg-warm) 75%
    );
    background-size: 400% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 10px;
}

/* --- Toast ------------------------------------------------ */

#toast {
    transition: opacity 0.3s, transform 0.3s;
    transform: translateX(-50%) translateY(0);
    border-radius: 14px;
    font-size: 14px;
}

#toast.toast-visible { opacity: 1; }
#toast.toast-hidden { opacity: 0; transform: translateX(-50%) translateY(10px); }

/* --- Zodiac Sign Icons ------------------------------------ */

.sign-icon { font-size: 28px; line-height: 1; }

/* --- Hook Predictions ------------------------------------- */

.hook-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px 24px;
    transition: border-color 0.3s, background 0.3s, transform 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.12);
}

.hook-card-single {
    background: var(--bg-card) !important;
    border: 1.5px solid var(--border-emphasis) !important;
    border-radius: 22px !important;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.2),
        0 1px 3px rgba(0, 0, 0, 0.18) !important;
    animation: card-appear 0.5s cubic-bezier(0.16, 1, 0.3, 1) both !important;
    position: relative;
    overflow: hidden;
}

/* Subtle shimmer overlay */
.hook-card-single::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.02), transparent);
    animation: shimmer 6s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.hook-card-single::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 22px;
    background: none;
    pointer-events: none;
    z-index: 2;
}

.hook-icon-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.hook-icon-circle {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    background: rgba(245, 158, 11, 0.06);
    border: 1.5px solid rgba(245, 158, 11, 0.15);
    position: relative;
    z-index: 1;
}
.hook-icon-circle svg {
    width: 32px;
    height: 32px;
}

/* Subtle orbit rings around icon */
.hook-icon-circle::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 1px dashed rgba(245, 158, 11, 0.1);
    animation: orbit-ring 8s linear infinite;
    pointer-events: none;
}

.hook-icon-circle::after {
    content: '';
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    border: 1px solid rgba(124, 58, 237, 0.06);
    animation: orbit-ring 12s linear infinite reverse;
    pointer-events: none;
}

.hook-statement {
    font-size: 21px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
    line-height: 1.35;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hook-hint {
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hook-counter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 158, 11, 0.04);
    border: 1px solid rgba(245, 158, 11, 0.12);
    border-radius: 999px;
    padding: 4px 14px;
    font-size: 12px;
    color: var(--accent);
    letter-spacing: 0.1em;
    font-variant-numeric: tabular-nums;
    animation: counter-badge-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hook-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

/* Verify button (Correct) */
.btn-verify {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #065F46, #047857, #059669) !important;
    color: #A7F3D0 !important;
    border: 1.5px solid rgba(5, 150, 105, 0.4) !important;
    border-radius: 14px !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    padding: 12px 20px !important;
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.15) !important;
    transition: transform 0.15s, box-shadow 0.2s, filter 0.15s !important;
    cursor: pointer;
    min-height: 48px;
}

.btn-verify-large {
    flex: 1 !important;
    padding: 14px 24px !important;
    font-size: 16px !important;
}

.btn-verify::before {
    content: '';
    position: absolute;
    top: 0;
    left: -80%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
    transform: skewX(-20deg);
    pointer-events: none;
}

.btn-verify:hover::before { animation: btn-shine 0.5s ease forwards; }

.btn-verify:hover:not(:disabled) {
    background: linear-gradient(135deg, #047857, #059669, #10B981) !important;
    box-shadow: 0 6px 24px rgba(5, 150, 105, 0.25) !important;
    transform: translateY(-1px) !important;
    filter: brightness(1.05);
}

.btn-verify:active:not(:disabled) {
    transform: translateY(0) scale(0.97) !important;
}

.btn-verify .btn-ripple-el {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    width: 60px;
    height: 60px;
    margin-top: -30px;
    margin-left: -30px;
    animation: btn-ripple 0.6s linear;
    pointer-events: none;
}

/* Deny button (Wrong) */
.btn-deny {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #7F1D1D, #991B1B, #B91C1C) !important;
    color: #FECACA !important;
    border: 1.5px solid rgba(220, 38, 38, 0.4) !important;
    border-radius: 14px !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    padding: 12px 20px !important;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.15) !important;
    transition: transform 0.15s, box-shadow 0.2s, filter 0.15s !important;
    cursor: pointer;
    min-height: 48px;
}

.btn-deny-large {
    flex: 1 !important;
    padding: 14px 24px !important;
    font-size: 16px !important;
}

.btn-deny::before {
    content: '';
    position: absolute;
    top: 0;
    left: -80%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: skewX(-20deg);
    pointer-events: none;
}

.btn-deny:hover::before { animation: btn-shine 0.5s ease forwards; }

.btn-deny:hover:not(:disabled) {
    background: linear-gradient(135deg, #991B1B, #B91C1C, #DC2626) !important;
    box-shadow: 0 6px 24px rgba(220, 38, 38, 0.25) !important;
    transform: translateY(-1px) !important;
    filter: brightness(1.05);
}

.btn-deny:active:not(:disabled) {
    transform: translateY(0) scale(0.97) !important;
}

.btn-deny .btn-ripple-el {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    width: 60px;
    height: 60px;
    margin-top: -30px;
    margin-left: -30px;
    animation: btn-ripple 0.6s linear;
    pointer-events: none;
}

/* Skip button */
.btn-skip {
    position: relative;
    overflow: hidden;
    background: var(--bg-warm) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-emphasis) !important;
    border-radius: 14px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    padding: 12px 20px !important;
    transition: all 0.2s ease !important;
    cursor: pointer;
    min-height: 44px;
}

.btn-skip:hover:not(:disabled) {
    background: var(--border) !important;
    border-color: var(--border-emphasis) !important;
    color: var(--text-primary) !important;
}

.btn-skip:active:not(:disabled) { transform: scale(0.97); }

/* Hook verified/denied flash */
.hook-verified {
    border-color: rgba(5, 150, 105, 0.4) !important;
    background: rgba(5, 150, 105, 0.04) !important;
    box-shadow: 0 0 24px rgba(5, 150, 105, 0.1), 0 4px 24px rgba(0, 0, 0, 0.2) !important;
    animation: result-flash-green 0.8s ease-out !important;
}

.hook-denied {
    border-color: rgba(220, 38, 38, 0.4) !important;
    background: rgba(220, 38, 38, 0.03) !important;
    box-shadow: 0 0 24px rgba(220, 38, 38, 0.08), 0 4px 24px rgba(0, 0, 0, 0.2) !important;
    animation: result-flash-red 0.8s ease-out !important;
}

.hook-result {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 14px;
}

/* --- Score Dots ------------------------------------------- */

.score-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--border);
    border: 1.5px solid var(--border-emphasis);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.score-dot-active {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
    animation: dot-pulse 1.5s ease-in-out infinite;
    transform: scale(1.2);
}

.score-dot-correct {
    background: var(--success);
    border-color: var(--success);
    box-shadow: 0 0 6px rgba(5, 150, 105, 0.3);
    animation: progress-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.score-dot-wrong {
    background: var(--error);
    border-color: var(--error);
    box-shadow: 0 0 6px rgba(220, 38, 38, 0.3);
    animation: progress-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.score-dot-skip {
    background: var(--text-muted);
    border-color: var(--text-muted);
}

/* --- Score Circle (SVG ring) ------------------------------ */

.score-circle {
    width: 160px;
    height: 160px;
    position: relative;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-ring-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-ring-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 6;
}

.score-ring-fill {
    fill: none;
    stroke: url(#score-gradient);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 440;
    stroke-dashoffset: 440;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-number {
    font-size: 40px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    animation: count-fade 0.5s ease-out;
    position: relative;
    z-index: 1;
}

.score-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    z-index: 1;
}

.score-breakdown { max-width: 220px; margin: 0 auto; }
.score-breakdown svg {
    display: inline;
    vertical-align: middle;
    margin-right: 2px;
}

.hook-score-section { padding: 20px 0; }

/* --- Gradient Titles -------------------------------------- */

.hooks-title-glow {
    background: var(--accent-gradient);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.reading-title-glow {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 22px;
    font-weight: 800;
}

/* --- Hook Card Transitions -------------------------------- */

.hook-card-container {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hook-card-container.hook-exiting {
    opacity: 0;
    transform: translateY(-12px) scale(0.97);
}

/* --- Full Reading ----------------------------------------- */

.reading-section {
    margin-bottom: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.reading-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    cursor: pointer;
    transition: background 0.2s;
    background: rgba(245, 158, 11, 0.02);
}

.reading-category-header:hover {
    background: rgba(245, 158, 11, 0.04);
}

.reading-category {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
    margin: 0;
}

.reading-chevron {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.reading-chevron.rotated { transform: rotate(-90deg); }

.reading-category-body {
    padding: 0 18px 14px;
}

.reading-category-body.collapsed { display: none; }

.reading-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.reading-row:last-child { border-bottom: none; }

.reading-label {
    color: var(--text-secondary);
    font-size: 14px;
    flex: 1;
}

.reading-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    text-align: right;
    max-width: 55%;
}

/* --- Skip-to-chat Button ---------------------------------- */

#skip-to-chat-btn {
    position: relative;
    overflow: hidden;
    background: var(--bg-warm) !important;
    border: 1px solid var(--border-emphasis) !important;
    color: var(--text-secondary) !important;
    font-weight: 500 !important;
    border-radius: 14px !important;
    padding: 12px 20px !important;
    transition: all 0.25s ease !important;
    min-height: 48px;
}

#skip-to-chat-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(245, 158, 11, 0.03) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: skip-btn-shimmer 3s ease-in-out infinite;
    pointer-events: none;
}

#skip-to-chat-btn:hover {
    background: var(--border) !important;
    border-color: var(--border-emphasis) !important;
    color: var(--text-primary) !important;
}

/* --- Paywall ---------------------------------------------- */

#view-paywall {
    min-height: 100vh;
    padding: 60px 16px 24px;
    /* display: flex + align/justify handled by Tailwind classes in HTML.
       DO NOT set display here — ID specificity overrides .hidden { display: none }. */
}

/* --- Payment Options -------------------------------------- */

.payment-options {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: stretch;
}

.payment-plan {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 18px 8px 14px;
    border-radius: 16px;
    border: 1.5px solid var(--border-emphasis);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    max-width: 142px;
    min-height: 142px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.payment-plan:hover {
    border-color: var(--accent);
    background: rgba(245, 158, 11, 0.03);
    transform: translateY(-2px);
}

.payment-plan:active {
    transform: translateY(0);
}

.payment-plan.popular {
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.1);
}

.payment-plan-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-gradient);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 10px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.payment-plan-title {
    min-height: 28px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.15;
    color: var(--text-primary);
    text-align: center;
}

.payment-plan-minutes {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
}

.payment-plan-price {
    font-size: 24px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.payment-plan-rate {
    font-size: 11px;
    color: var(--text-muted);
}

.payment-plan.loading {
    opacity: 0.6;
    pointer-events: none;
}

.payment-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.paywall-lead {
    width: 100%;
    text-align: left;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
}

.paywall-lead label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

.paywall-lead p {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.35;
    color: var(--text-muted);
}

@media (max-width: 430px) {
    .payment-options {
        flex-direction: column;
    }

    .payment-plan {
        width: 100%;
        max-width: none;
        min-height: auto;
    }
}

/* --- Responsive ------------------------------------------- */

@media (max-width: 320px) {
    .msg-bubble {
        max-width: 90%;
        font-size: 14px;
        padding: 10px 14px;
    }

    .kundli-cell {
        font-size: 9px;
        padding: 4px;
    }

    .kundli-cell .cell-sign { font-size: 6px; }
    .kundli-cell .cell-planets { font-size: 9px; }

    .quick-chip {
        font-size: 12px;
        padding: 8px 12px;
    }

    .hook-statement { font-size: 18px; }
}

/* Safe area for notched phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
    }
}

/* --- Print ------------------------------------------------ */

@media print {
    header, .bottom-nav, .chat-input-bar { display: none; }
}

/* --- Loading Steps Animation Delays ----------------------- */

#loading-steps > div:nth-child(1) .loading-step-dot { animation-delay: 0s; }
#loading-steps > div:nth-child(2) .loading-step-dot { animation-delay: 0.5s; }
#loading-steps > div:nth-child(3) .loading-step-dot { animation-delay: 1s; }
#loading-steps > div:nth-child(4) .loading-step-dot { animation-delay: 1.5s; }

/* --- Progress Dots Row ------------------------------------ */

.hook-score-dots,
.score-dots-row {
    gap: 10px;
}

/* --- Splash Screen ---------------------------------------- */

#view-splash {
    padding-top: 60px;
    min-height: 100vh;
    /* display: flex + align/justify handled by Tailwind classes in HTML.
       DO NOT set display here — ID specificity overrides .hidden { display: none }. */
}

.splash-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.splash-fade-in {
    animation: splashIn 0.6s ease-out both;
}

@keyframes splashIn {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.splash-fade-out {
    animation: splashOut 0.4s ease-in forwards;
}

@keyframes splashOut {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to { opacity: 0; transform: scale(0.95) translateY(-10px); }
}

/* --- Onboarding Form (single-screen) ---------------------- */

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

.onboard-form {
    animation: fadeInUp 0.35s ease-out both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.onboard-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
    text-align: center;
}

/* Two-column row for date + time */
.onboard-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Compact inline gender pills */
.onboard-gender-row {
    display: flex;
    gap: 10px;
}

.onboard-gender-option {
    flex: 1;
    cursor: pointer;
}

.onboard-gender-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.onboard-gender-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 2px solid var(--border-emphasis);
    background: var(--bg-card);
    transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.onboard-gender-option input:checked + .onboard-gender-pill {
    border-color: var(--accent);
    background: rgba(245, 158, 11, 0.04);
    color: var(--accent);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.1);
}

.onboard-gender-pill:active {
    transform: scale(0.97);
}

.onboard-gender-pill svg {
    color: inherit;
}

/* Highlight invalid fields on submit attempt */
.onboard-form .astro-input-shell.field-error {
    border-color: #EF4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

/* --- Home Screen ------------------------------------------ */

/* --- Home Screen (Redesigned) -------------------------------- */

#view-home {
    padding-top: 56px;
    padding-bottom: calc(72px + var(--safe-bottom));
}

.home-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Compact greeting — NOT a giant hero banner */
.home-header-card {
    padding: 16px 20px;
    background: var(--bg-hero);
    border-radius: 16px;
    color: var(--text-primary);
}
.home-greeting {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.home-greeting-text {
    font-size: 14px;
    opacity: 0.8;
}
.home-user-name {
    font-size: 22px;
    font-weight: 700;
}
.home-rashi-badge {
    margin-top: 4px;
    font-size: 13px;
    opacity: 0.7;
}

/* Section labels — small uppercase muted */
.home-section-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

/* Energy traffic light — the daily hook */
.home-energy-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.energy-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: center;
}
.energy-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.energy-good .energy-dot { background: #059669; }
.energy-ok .energy-dot { background: #D97706; }
.energy-caution .energy-dot { background: #DC2626; }
.energy-area {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}
.energy-level {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Chat CTA — horizontal card, not a button */
.home-chat-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-card);
    border: 1.5px solid var(--accent);
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.home-chat-cta:active {
    transform: scale(0.98);
}
.home-chat-cta:hover {
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.1);
}
.home-chat-cta-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(245, 158, 11, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}
.home-chat-cta-text {
    flex: 1;
}
.home-chat-cta-text strong {
    display: block;
    font-size: 15px;
    color: var(--text-primary);
}
.home-chat-cta-text span {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.home-chat-cta > svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Rashifal preview — compact horizontal card */
.home-rashifal-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.home-rashifal-card:active {
    transform: scale(0.98);
}
.home-rashifal-card:hover {
    border-color: rgba(245, 158, 11, 0.25);
}
.rashifal-sign {
    font-size: 28px;
    flex-shrink: 0;
}
.rashifal-content {
    flex: 1;
    min-width: 0;
}
.rashifal-content strong {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
}
.rashifal-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 4px 0 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Services — horizontal scroll pills, NOT a 3x3 grid */
.home-services-section {
    display: flex;
    flex-direction: column;
}
.home-services-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}
.home-services-scroll::-webkit-scrollbar { display: none; }
.service-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    min-width: 72px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
    flex-shrink: 0;
}
.service-pill:active {
    transform: scale(0.95);
}
.service-pill:hover {
    border-color: rgba(245, 158, 11, 0.25);
}
.service-pill svg {
    color: var(--accent);
}
.service-pill span {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

/* Panchang grid — 2x2 */
.home-panchang-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.panchang-item {
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.panchang-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.panchang-value {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2px;
}

/* Daily wisdom tip */
.home-tip-section {
    text-align: center;
    padding: 16px;
    background: var(--bg-warm);
    border-radius: 14px;
}
.home-tip {
    font-size: 14px;
    color: var(--text-primary);
    font-style: italic;
    line-height: 1.5;
    margin: 0;
}
.home-tip-source {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    display: block;
}

/* Desktop: wider home container */
@media (min-width: 768px) {
    .home-container {
        max-width: 680px;
        padding: 24px;
        gap: 20px;
    }
    .home-header-card {
        padding: 20px 24px;
    }
    .home-user-name {
        font-size: 26px;
    }
}

/* --- Horoscope Period Tabs -------------------------------- */

.horoscope-tabs {
    display: flex;
    gap: 0;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 3px;
    overflow: hidden;
}

.horo-tab {
    flex: 1;
    padding: 10px 8px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 40px;
}

.horo-tab.active {
    background: var(--bg-card);
    color: var(--accent);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.horo-tab:active {
    transform: scale(0.97);
}

/* --- Matchmaking View ------------------------------------- */

#view-matchmaking {
    padding-top: 60px;
    padding-bottom: calc(72px + var(--safe-bottom));
}

.match-score-card {
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.match-score-number {
    font-size: 48px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.match-score-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.match-koota-table {
    width: 100%;
    font-size: 13px;
    border-collapse: collapse;
}

.match-koota-table th {
    text-align: left;
    padding: 8px 12px;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}

.match-koota-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}

.match-koota-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: var(--accent);
}

.match-manglik {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.match-recommendation {
    background: rgba(245, 158, 11, 0.04);
    border: 1px solid rgba(245, 158, 11, 0.12);
    border-radius: 12px;
    padding: 16px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- Panchang View ---------------------------------------- */

#view-panchang {
    padding-top: 60px;
    padding-bottom: calc(72px + var(--safe-bottom));
}

.panchang-date-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panchang-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.panchang-cell {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.panchang-cell-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.panchang-cell-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
}

.panchang-times {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
}

.panchang-time-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

/* --- Dasha Timeline View ---------------------------------- */

#view-dasha {
    padding-top: 60px;
    padding-bottom: calc(72px + var(--safe-bottom));
}

.dasha-current-banner {
    background: rgba(245, 158, 11, 0.04);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
}

.dasha-timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.dasha-timeline-item.dasha-tl-current {
    border-color: var(--accent);
    background: rgba(245, 158, 11, 0.03);
}

.dasha-timeline-item.dasha-tl-past {
    opacity: 0.5;
}

.dasha-tl-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-emphasis);
    flex-shrink: 0;
    margin-top: 4px;
}

.dasha-tl-current .dasha-tl-dot {
    background: var(--accent);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
}

.dasha-tl-past .dasha-tl-dot {
    background: var(--text-muted);
}

.dasha-tl-info {
    flex: 1;
}

.dasha-tl-planet {
    font-weight: 700;
    color: var(--accent);
    font-size: 15px;
}

.dasha-tl-current .dasha-tl-planet {
    color: var(--accent);
}

.dasha-tl-dates {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.dasha-tl-sub {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(245, 158, 11, 0.03);
    border: 1px solid rgba(245, 158, 11, 0.1);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.dasha-tl-sub strong {
    color: var(--accent);
}

/* --- Toast variants --------------------------------------- */

#toast.toast-success {
    background: var(--bg-card);
    border-color: #22c55e;
    color: #4ade80;
}

#toast.toast-info {
    background: var(--bg-card);
    border-color: var(--accent);
    color: var(--accent);
}

#toast.toast-error {
    background: var(--bg-card);
    border-color: #f87171;
    color: #fca5a5;
}

/* --- Onboarding V2 --------------------------------------- */

header#header {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 40px rgba(4, 6, 18, 0.28);
}

header .header-inner {
    min-height: 66px;
}

header .logo-text {
    background: linear-gradient(135deg, #FBBF24, #F59E0B 60%, #FCD34D);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#lang-toggle,
#timer {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body[data-current-view="splash"] header#header,
body[data-current-view="onboarding"] header#header,
body[data-current-view="loading"] header#header {
    background:
        linear-gradient(180deg, rgba(6, 10, 30, 0.68) 0%, rgba(6, 10, 30, 0.18) 100%);
    border-bottom-color: rgba(251, 191, 36, 0.06);
    box-shadow: none;
}

body[data-current-view="splash"],
body[data-current-view="onboarding"],
body[data-current-view="loading"] {
    background:
        radial-gradient(circle at top left, rgba(245, 158, 11, 0.16), transparent 30%),
        linear-gradient(180deg, #060A1E 0%, #121834 38%, #20184D 100%);
}

#view-splash,
#view-onboarding,
#view-loading {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(circle at top left, rgba(245, 158, 11, 0.18), transparent 34%),
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.18), transparent 38%),
        linear-gradient(180deg, #060A1E 0%, #121834 38%, #20184D 100%);
}

#view-splash::before,
#view-onboarding::before,
#view-loading::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.85) 0 1px, transparent 1.3px),
        radial-gradient(circle at 24% 62%, rgba(251, 191, 36, 0.75) 0 1.1px, transparent 1.4px),
        radial-gradient(circle at 73% 24%, rgba(255, 255, 255, 0.75) 0 1px, transparent 1.4px),
        radial-gradient(circle at 82% 68%, rgba(251, 191, 36, 0.7) 0 1.2px, transparent 1.6px),
        radial-gradient(circle at 44% 12%, rgba(255, 255, 255, 0.7) 0 1px, transparent 1.3px),
        radial-gradient(circle at 58% 84%, rgba(245, 158, 11, 0.68) 0 1.1px, transparent 1.5px);
    opacity: 0.78;
    pointer-events: none;
}

#view-splash::after,
#view-onboarding::after,
#view-loading::after {
    content: '';
    position: absolute;
    inset: auto -10% -28% -10%;
    height: 52%;
    background:
        radial-gradient(circle at center, rgba(251, 191, 36, 0.16), transparent 55%);
    filter: blur(26px);
    pointer-events: none;
}

#view-splash > *,
#view-onboarding > *,
#view-loading > * {
    position: relative;
    z-index: 1;
}

#view-splash .splash-icon {
    color: #FBBF24;
    margin-bottom: 8px;
}

#view-splash .text-3xl {
    font-size: 42px;
    letter-spacing: -0.04em;
}

#view-splash p[data-i18n="splash_tagline"] {
    color: rgba(245, 230, 211, 0.88) !important;
    font-size: 15px;
}

#view-loading > div {
    width: min(100%, 380px);
    padding: 28px 24px;
    border-radius: 28px;
    border: 1px solid rgba(251, 191, 36, 0.12);
    background:
        linear-gradient(180deg, rgba(13, 18, 44, 0.92), rgba(12, 17, 41, 0.84));
    box-shadow:
        0 24px 70px rgba(4, 6, 18, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#view-loading .loading-spinner {
    color: #FBBF24;
}

#view-loading .text-orange-600 {
    color: #F8FAFC !important;
}

#view-loading .text-stone-400 {
    color: rgba(224, 225, 241, 0.72) !important;
}

#view-loading .loading-step-row.step-active {
    color: #FCD34D;
}

#view-loading .loading-step-row.step-pending {
    color: rgba(209, 213, 219, 0.58);
}

#view-loading .loading-step-dot {
    background: rgba(148, 163, 184, 0.34);
}

#view-loading .loading-step-dot.dot-active {
    background: #FBBF24;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.42);
}

#view-onboarding {
    padding: 84px 16px 32px;
}

.onboarding-shell {
    width: 100%;
    max-width: 1120px;
    display: grid;
    gap: 20px;
}

.onboarding-story,
.onboarding-panel {
    position: relative;
}

.onboarding-story {
    padding: 26px 20px;
    border-radius: 28px;
    border: 1px solid rgba(251, 191, 36, 0.12);
    background:
        linear-gradient(180deg, rgba(14, 20, 49, 0.88), rgba(11, 16, 40, 0.76));
    box-shadow:
        0 24px 70px rgba(4, 6, 18, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.onboarding-story::before,
.onboarding-panel::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

.onboarding-story-badge,
.onboarding-panel-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(251, 191, 36, 0.16);
    background: rgba(251, 191, 36, 0.08);
    color: #FCD34D;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.onboarding-story-badge {
    margin-bottom: 18px;
}

.onboarding-story-badge-icon {
    display: inline-flex;
    color: #FBBF24;
}

.onboarding-story-copy {
    display: grid;
    gap: 10px;
}

.onboarding-hero-icon {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    background: radial-gradient(circle at 30% 30%, rgba(251, 191, 36, 0.26), rgba(245, 158, 11, 0.08));
    color: #FBBF24;
    box-shadow: 0 18px 38px rgba(245, 158, 11, 0.12);
}

.onboarding-story-kicker {
    margin: 0;
    color: rgba(245, 230, 211, 0.86);
    font-size: 13px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.onboarding-story-title {
    margin: 0;
    color: #F8FAFC;
    font-size: clamp(30px, 6.3vw, 54px);
    line-height: 1.02;
    letter-spacing: -0.05em;
    font-weight: 800;
}

.onboarding-story-subtitle {
    margin: 0;
    max-width: 620px;
    color: rgba(226, 232, 240, 0.8);
    font-size: 15px;
    line-height: 1.7;
}

.onboarding-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.onboarding-trust-chip {
    padding: 9px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.52);
    color: rgba(248, 250, 252, 0.78);
    font-size: 12px;
    font-weight: 600;
}

.onboarding-service-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.onboarding-service-card,
.onboarding-proof-card {
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background:
        linear-gradient(180deg, rgba(16, 22, 48, 0.82), rgba(12, 17, 39, 0.72));
}

.onboarding-service-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 72px;
    padding: 14px;
    color: #F8FAFC;
    font-size: 14px;
    font-weight: 600;
}

.onboarding-service-icon,
.onboarding-proof-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: radial-gradient(circle at 35% 35%, rgba(251, 191, 36, 0.22), rgba(245, 158, 11, 0.08));
    color: #FBBF24;
}

.onboarding-proof-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    margin-top: 18px;
    padding: 16px;
}

.onboarding-proof-card h3 {
    margin: 0 0 6px;
    color: #F8FAFC;
    font-size: 16px;
    font-weight: 700;
}

.onboarding-proof-card p {
    margin: 0;
    color: rgba(226, 232, 240, 0.72);
    font-size: 14px;
    line-height: 1.6;
}

.onboarding-panel.ap-form-shell {
    max-width: none;
    padding: 24px 18px 18px;
    border-radius: 28px;
    border-color: rgba(251, 191, 36, 0.14);
    background: var(--bg-card);
    box-shadow:
        0 28px 70px rgba(4, 6, 18, 0.4),
        0 2px 0 rgba(255, 255, 255, 0.06) inset;
}

.onboarding-panel-top {
    display: grid;
    gap: 14px;
}

.onboarding-panel-badge {
    justify-self: start;
    color: var(--accent);
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.14);
}

.onboarding-progress {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
}

.wizard-back,
.astro-secondary-btn,
.wizard-link {
    font: inherit;
}

.wizard-back {
    border: 0;
    background: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 700;
    padding: 0;
    cursor: pointer;
}

.wizard-back[disabled] {
    opacity: 0.38;
    cursor: default;
}

.wizard-dots {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.wizard-dot {
    display: block;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(160, 144, 128, 0.22);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.wizard-dot.is-active {
    background: var(--accent-gradient);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.2);
    transform: scaleY(1.08);
}

.wizard-dot.is-complete {
    background: rgba(245, 158, 11, 0.42);
}

.wizard-count {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
}

.wizard-question {
    margin: 0;
    color: var(--text-primary);
    font-size: 28px;
    line-height: 1.15;
    letter-spacing: -0.04em;
    font-weight: 800;
}

.wizard-helper {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.onboard-form {
    margin-top: 20px;
}

.onboard-step {
    min-height: 178px;
}

.onboard-step-label {
    margin-bottom: 10px;
    text-align: left;
    color: var(--text-primary);
    opacity: 0.72;
}

.onboarding-panel .astro-input-shell {
    border: 1.5px solid var(--border-emphasis);
    background: var(--bg-warm);
    box-shadow: 0 10px 26px rgba(245, 158, 11, 0.04);
}

.onboarding-panel .astro-input-shell:focus-within {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1), 0 16px 28px rgba(245, 158, 11, 0.08);
}

.onboarding-panel .astro-input {
    font-size: 16px;
}

.onboard-gender-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.onboard-gender-pill {
    min-height: 78px;
    flex-direction: column;
    gap: 10px;
    border-width: 1.5px;
    border-radius: 18px;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-warm);
}

.onboard-gender-option input:checked + .onboard-gender-pill {
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.06));
    box-shadow: 0 18px 24px rgba(245, 158, 11, 0.08);
}

.onboard-inline-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.wizard-link {
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(245, 158, 11, 0.16);
    background: rgba(245, 158, 11, 0.08);
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.wizard-inline-note {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.onboarding-actions {
    display: grid;
    gap: 10px;
}

.astro-secondary-btn {
    width: 100%;
    min-height: 52px;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.astro-secondary-btn:hover {
    border-color: rgba(245, 158, 11, 0.22);
    box-shadow: 0 14px 24px rgba(245, 158, 11, 0.06);
}

.astro-secondary-btn:active {
    transform: scale(0.98);
}

.onboarding-free-note {
    margin: 12px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    text-align: center;
}

.onboard-form .astro-input-shell.field-error {
    border-color: rgba(220, 38, 38, 0.8);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

@media (max-width: 767px) {
    #view-splash,
    #view-loading,
    #view-onboarding {
        padding-left: 16px;
        padding-right: 16px;
    }

    .onboarding-story-title {
        font-size: 34px;
    }

    .onboarding-service-grid {
        display: none;
    }

    .onboarding-proof-card {
        display: none;
    }
}

@media (min-width: 768px) {
    #view-onboarding:not(.hidden) {
        padding: 60px 40px 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 100vh;
    }

    .onboarding-shell {
        max-width: 1100px;
        grid-template-columns: 1fr minmax(360px, 420px);
        align-items: center;
        gap: 36px;
    }

    .onboarding-story {
        padding: 32px 30px;
    }

    .onboarding-story-copy {
        gap: 6px;
    }

    .onboarding-story-title {
        max-width: 560px;
        font-size: clamp(28px, 3.2vw, 40px);
    }

    .onboarding-story-subtitle {
        font-size: 14px;
        line-height: 1.6;
    }

    .onboarding-story-badge {
        margin-bottom: 14px;
    }

    .onboarding-hero-icon {
        width: 56px;
        height: 56px;
        border-radius: 18px;
    }

    .onboarding-hero-icon svg {
        width: 38px;
        height: 38px;
    }

    .onboarding-trust-row {
        margin-top: 14px;
        gap: 8px;
    }

    .onboarding-trust-chip {
        padding: 7px 10px;
        font-size: 11px;
    }

    /* Service grid: horizontal 4-col on desktop */
    .onboarding-service-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        margin-top: 16px !important;
        gap: 10px !important;
    }

    .onboarding-service-card {
        flex-direction: column;
        text-align: center;
        gap: 6px;
        padding: 12px 6px;
        min-height: 56px;
        font-size: 12px;
    }

    .onboarding-service-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .onboarding-service-icon svg {
        width: 16px;
        height: 16px;
    }

    .onboarding-proof-card {
        margin-top: 14px;
        padding: 12px;
    }

    .onboarding-proof-card h3 {
        font-size: 14px;
    }

    .onboarding-proof-card p {
        font-size: 13px;
        line-height: 1.5;
    }

    .onboarding-proof-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .onboarding-panel.ap-form-shell {
        padding: 28px 24px 20px;
        align-self: center;
    }

    #view-loading > div {
        width: 420px;
    }
}

/* --- Chat FAB (Floating Action Button) -------------------- */

.chat-fab {
    position: fixed;
    bottom: calc(70px + var(--safe-bottom));
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white;
    border: none;
    cursor: pointer;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    animation: chat-fab-pulse 3s ease-in-out infinite;
}

.chat-fab:active {
    transform: scale(0.92);
}

@keyframes chat-fab-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 4px 30px rgba(245, 158, 11, 0.5); }
}

/* --- Chat Overlay (Mobile) -------------------------------- */

.chat-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: 5;
}

.chat-overlay-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.chat-overlay-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

/* Mobile chat overlay mode */
body.chat-overlay-open #view-chat {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 55 !important;
    background: var(--bg-page) !important;
    padding-top: 0 !important;
}

body.chat-overlay-open .chat-overlay-header {
    display: flex !important;
}

body.chat-overlay-open .bottom-nav {
    display: none !important;
}

body.chat-overlay-open .chat-fab {
    display: none !important;
}

body.chat-overlay-open .chat-input-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    max-width: none !important;
    width: 100% !important;
}

@media (prefers-reduced-motion: reduce) {
    #view-splash::after,
    #view-onboarding::after,
    #view-loading::after,
    .wizard-dot,
    .onboard-form,
    .animate-float-gentle,
    .loading-star-svg {
        animation: none !important;
        transition: none !important;
    }
}
