@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
    --bg-deep:    #010812;
    --bg-dark:    #060d1f;
    --bg-card:    rgba(4, 18, 50, 0.75);
    --bg-card-hover: rgba(6, 25, 65, 0.85);
    --card-border: rgba(212, 175, 55, 0.15);
    --card-border-hover: rgba(212, 175, 55, 0.4);

    --gold:       #D4AF37;
    --gold-light: #F5D76E;
    --gold-dim:   #b8942a;
    --gold-glow:  rgba(212, 175, 55, 0.25);
    --gold-glow2: rgba(212, 175, 55, 0.08);

    --text-main:  #F0E6C8;
    --text-dim:   rgba(212, 175, 55, 0.5);
    --text-muted: rgba(200, 185, 150, 0.6);

    --success: #4ade80;
    --error:   #f87171;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-deep);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
}

/* ─── BACKGROUND ─── */
.background-canvas {
    position: fixed; inset: 0; z-index: 0;
    overflow: hidden; pointer-events: none;
}
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0;
    animation: orb-breathe 18s ease-in-out infinite alternate;
}
.bg-orb-1 {
    width: 700px; height: 700px;
    background: radial-gradient(circle, rgba(10, 30, 80, 0.9) 0%, transparent 70%);
    top: -200px; left: -200px;
    opacity: 1;
    animation-delay: 0s;
}
.bg-orb-2 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.06) 0%, transparent 70%);
    bottom: -150px; right: -150px;
    opacity: 1;
    animation-delay: -6s;
}
.bg-orb-3 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(5, 20, 60, 0.8) 0%, transparent 70%);
    top: 40%; left: 35%;
    opacity: 1;
    animation-delay: -12s;
}
.bg-stars {
    position: absolute; inset: 0;
    background-image:
        radial-gradient(1px 1px at 15% 20%, rgba(212,175,55,0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 80% 10%, rgba(212,175,55,0.2) 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 70%, rgba(212,175,55,0.25) 0%, transparent 100%),
        radial-gradient(1px 1px at 25% 85%, rgba(212,175,55,0.2) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 90% 50%, rgba(212,175,55,0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 45% 35%, rgba(212,175,55,0.15) 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 90%, rgba(212,175,55,0.2) 0%, transparent 100%);
}

@keyframes orb-breathe {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(40px, 30px) scale(1.08); }
}

/* ─── LAYOUT ─── */
.app-container {
    position: relative; z-index: 10;
    width: 100%; max-width: 780px;
    padding: 30px 20px 60px;
}

.screen {
    display: none;
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: 28px;
    padding: 48px 44px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(212, 175, 55, 0.04);
    animation: screen-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.screen.active { display: block; }

@keyframes screen-in {
    from { opacity: 0; transform: translateY(28px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── DECORATIVE LINE ─── */
.gold-line {
    width: 60px; height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 16px auto 24px;
}

/* ─── BADGE ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--gold-glow2);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--gold);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 50px;
    margin-bottom: 20px;
}

/* ─── WELCOME SCREEN ─── */
.welcome-header { text-align: center; margin-bottom: 36px; }

h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.15;
    background: linear-gradient(160deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dim) 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto;
}

/* ─── STATS ROW ─── */
.stats-row {
    display: flex;
    justify-content: center;
    gap: 28px;
    list-style: none;
    margin: 32px 0;
    flex-wrap: wrap;
}
.stats-row li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 24px;
    background: var(--gold-glow2);
    border: 1px solid rgba(212,175,55,0.15);
    border-radius: 16px;
    min-width: 110px;
}
.stats-row .stat-val {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
}
.stats-row .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.06em;
}

/* ─── INFO CARD ─── */
.info-card {
    background: rgba(212, 175, 55, 0.04);
    border: 1px solid rgba(212, 175, 55, 0.12);
    border-radius: 16px;
    padding: 22px 26px;
    margin-bottom: 28px;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.65;
}

/* ─── BUTTONS ─── */
.btn-primary {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 32px auto 0;
    padding: 18px 32px;
    border-radius: 14px;
    border: 1px solid rgba(212,175,55,0.5);
    background: linear-gradient(135deg, rgba(212,175,55,0.18) 0%, rgba(212,175,55,0.08) 100%);
    color: var(--gold-light);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.btn-primary::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(212,175,55,0.25), rgba(212,175,55,0.05));
    opacity: 0;
    transition: opacity 0.3s;
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:hover {
    border-color: var(--gold);
    box-shadow: 0 0 30px var(--gold-glow), 0 8px 24px rgba(0,0,0,0.4);
    transform: translateY(-2px);
    color: #fff;
}
.btn-primary:disabled {
    opacity: 0.5; cursor: not-allowed;
    transform: none; box-shadow: none;
}

.btn-secondary {
    display: block;
    width: 100%; max-width: 320px;
    margin: 24px auto 0;
    padding: 14px 32px;
    border-radius: 12px;
    border: 1px solid rgba(212,175,55,0.2);
    background: transparent;
    color: var(--text-dim);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.03em;
}
.btn-secondary:hover {
    border-color: rgba(212,175,55,0.4);
    color: var(--gold);
}

/* ─── QUIZ SCREEN ─── */
.quiz-header { margin-bottom: 32px; }

.progress-container { margin-bottom: 18px; }
.progress-bar-wrapper {
    width: 100%; height: 4px;
    background: rgba(212,175,55,0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dim), var(--gold), var(--gold-light));
    border-radius: 4px;
    transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px var(--gold-glow);
}
#progress-text {
    font-size: 0.82rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
}

#quiz-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
}

.btn-back {
    background: transparent;
    border: 1px solid rgba(212,175,55,0.2);
    color: var(--text-dim);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.03em;
}
.btn-back:hover {
    color: var(--gold);
    border-color: rgba(212,175,55,0.5);
    background: rgba(212,175,55,0.05);
}

#section-title {
    font-size: 0.78rem;
    color: var(--gold);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    margin: 0;
}

#question-container { padding: 12px 0; }

h3#question-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.65rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-main);
    margin-bottom: 28px;
}

/* ─── OPTIONS ─── */
.options-grid { display: grid; gap: 12px; }

.option-btn {
    background: rgba(212, 175, 55, 0.03);
    border: 1px solid rgba(212,175,55,0.12);
    border-radius: 14px;
    padding: 18px 22px;
    text-align: left;
    color: var(--text-main);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.22s ease;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
}
.option-btn::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(212,175,55,0.08), transparent);
    opacity: 0;
    transition: opacity 0.22s;
}
.option-btn:hover::after { opacity: 1; }
.option-btn:hover {
    border-color: rgba(212,175,55,0.45);
    box-shadow: 0 0 20px rgba(212,175,55,0.07);
    transform: translateX(4px);
    color: #fff;
}
.option-letter {
    flex-shrink: 0;
    width: 32px; height: 32px;
    border: 1px solid rgba(212,175,55,0.3);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.82rem;
    color: var(--gold-dim);
    font-weight: 600;
    transition: all 0.22s;
    background: rgba(212,175,55,0.05);
}
.option-btn:hover .option-letter {
    background: var(--gold);
    color: var(--bg-deep);
    border-color: var(--gold);
    box-shadow: 0 0 12px var(--gold-glow);
}

/* ─── CONTACT SCREEN ─── */
.contact-header { text-align: center; margin-bottom: 32px; }
.contact-header h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}
.contact-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.contact-form { display: grid; gap: 16px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label {
    font-size: 0.8rem;
    color: var(--gold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
}
.form-group input {
    background: rgba(212,175,55,0.04);
    border: 1px solid rgba(212,175,55,0.2);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.22s ease;
    outline: none;
    width: 100%;
}
.form-group input::placeholder {
    color: rgba(212,175,55,0.25);
}
.form-group input:focus {
    border-color: var(--gold);
    background: rgba(212,175,55,0.07);
    box-shadow: 0 0 0 3px rgba(212,175,55,0.1);
}
.form-group input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(248,113,113,0.15);
}
.field-error {
    font-size: 0.78rem;
    color: var(--error);
    display: none;
}
.field-error.visible { display: block; }

.form-agree {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 4px;
}
.form-agree input[type="checkbox"] {
    width: 16px; height: 16px;
    margin-top: 2px;
    accent-color: var(--gold);
    flex-shrink: 0;
}

.submit-status {
    text-align: center;
    font-size: 0.9rem;
    min-height: 24px;
    color: var(--text-muted);
    margin-top: 8px;
}
.submit-status.error-state { color: var(--error); }
.submit-status.success-state { color: var(--success); }

/* ─── RESULT SCREEN ─── */
.result-header { text-align: center; margin-bottom: 32px; }

.score-circle {
    width: 130px; height: 130px;
    border: 2px solid var(--gold);
    border-radius: 50%;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    margin: 0 auto 24px;
    background: radial-gradient(circle, rgba(212,175,55,0.1) 0%, transparent 70%);
    box-shadow: 0 0 40px rgba(212,175,55,0.2);
    animation: circle-pulse 3s ease-in-out infinite alternate;
}
@keyframes circle-pulse {
    from { box-shadow: 0 0 30px rgba(212,175,55,0.15); }
    to   { box-shadow: 0 0 60px rgba(212,175,55,0.3); }
}
#final-score {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3rem; font-weight: 700;
    color: var(--gold); line-height: 1;
}
.score-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 4px;
}

h2#result-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0;
}

.result-text {
    line-height: 1.75;
    font-size: 0.98rem;
    color: var(--text-muted);
}
.result-text p { margin-bottom: 16px; }

/* ─── DIAGNOSIS CARDS ─── */
.diag-section { margin-top: 28px; }

.diag-card {
    background: rgba(212,175,55,0.04);
    border: 1px solid rgba(212,175,55,0.14);
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: 14px;
}
.diag-card h4 {
    font-size: 0.9rem;
    color: var(--gold);
    margin-bottom: 10px;
    letter-spacing: 0.04em;
}

.contradiction-card {
    border-color: rgba(248,113,113,0.25) !important;
    background: rgba(248,113,113,0.04) !important;
}
.contradiction-card h4 { color: #f87171; }

.cta-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}
.cta-btn {
    text-align: left;
    padding: 16px 20px;
    background: rgba(212,175,55,0.04);
    border: 1px solid rgba(212,175,55,0.2);
    border-radius: 14px;
    color: var(--text-main);
    font-size: 0.97rem;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Inter', sans-serif;
}
.cta-btn:hover {
    border-color: var(--gold);
    background: rgba(212,175,55,0.09);
    box-shadow: 0 0 20px rgba(212,175,55,0.1);
    color: #fff;
}
.cta-btn strong { color: var(--gold-light); }

/* ─── LOADING SPINNER ─── */
.spinner {
    display: inline-block;
    width: 20px; height: 20px;
    border: 2px solid rgba(212,175,55,0.3);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── RESPONSIVE ─── */
@media (max-width: 640px) {
    .screen { padding: 32px 22px; }
    h1 { font-size: 2.2rem; }
    h3#question-text { font-size: 1.35rem; }
    .form-row { grid-template-columns: 1fr; }
    .contact-header h2 { font-size: 1.8rem; }
    .stats-row { gap: 14px; }
    .stats-row li { padding: 12px 16px; min-width: 90px; }
}
