/* POEM survey — reuses the es_landing design tokens */

:root {
    --bg:        #ffffff;
    --surface:   #f8f7fc;
    --text:      #1a1730;
    --muted:     #6b6488;
    --line:      #e8e4f4;
    --primary:   #432e8d;
    --primary-dark: #1c123a;
    --primary-h: #2f1f68;
    --accent:    #744dfe;
    --accent-bg: #f2effc;
    --radius:    12px;
    --max:       1080px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--text);
    background: var(--surface);
    font-family: -apple-system, BlinkMacSystemFont, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; display: block; }

.skip-link {
    position: absolute; left: 16px; top: -48px;
    background: var(--primary); color: #fff;
    padding: 10px 14px; border-radius: var(--radius);
    z-index: 30;
}
.skip-link:focus { top: 16px; }

/* Header */
.poem-header {
    position: sticky; top: 0; z-index: 20;
    background: rgba(255,255,255,0.94);
    border-bottom: 1px solid var(--line);
}
.poem-header-inner {
    width: min(var(--max), calc(100% - 40px));
    margin: 0 auto;
    min-height: 68px;
    display: flex; align-items: center;
}
.brand {
    display: inline-flex; align-items: center; gap: 10px;
    text-decoration: none; font-weight: 800; letter-spacing: 0.02em;
}
.brand-mark {
    width: 40px; height: 40px; border-radius: 10px;
    display: grid; place-items: center;
    background: #fff; padding: 3px;
}
.brand-logo { width: 100%; height: 100%; object-fit: contain; }

/* Layout */
.poem-main {
    width: min(var(--max), calc(100% - 40px));
    margin: 0 auto;
    padding: 48px 0 72px;
}
.poem-card {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 40px;
    max-width: 680px;
    margin: 0 auto;
    box-shadow: 0 1px 3px rgba(28,18,58,0.06);
}

/* Intro */
.eyebrow {
    display: inline-block;
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.poem-intro h1 {
    margin: 0 0 12px;
    font-size: clamp(1.6rem, 3.4vw, 2.2rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
}
.lead { color: var(--muted); font-size: 1.0rem; margin: 0; }
.poem-hint { margin: 10px 0 0; color: var(--muted); font-size: 0.88rem; }

.poem-error {
    margin: 20px 0 0;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: #fdecec;
    border: 1px solid #f5c6c6;
    color: #a03232;
    font-weight: 600;
}

/* Progress bar */
.progress {
    height: 6px;
    background: var(--line);
    border-radius: 999px;
    overflow: hidden;
    margin: 28px 0 8px;
}
.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    transition: width 260ms ease;
}

/* Slides */
.slide { display: none; }
.slide.active { display: block; animation: fade 220ms ease; }
@keyframes fade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.q-count { margin: 16px 0 4px; color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.q-text {
    margin: 0 0 24px;
    font-size: clamp(1.2rem, 2.4vw, 1.5rem);
    line-height: 1.45;
    letter-spacing: -0.01em;
}

/* Options */
.options {
    display: grid;
    gap: 10px;
}
.option {
    display: flex; align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 18px;
    cursor: pointer;
    background: var(--bg);
    transition: border-color 140ms ease, background 140ms ease;
}
.option:hover { border-color: var(--accent); background: var(--accent-bg); }
.option input { position: absolute; opacity: 0; width: 0; height: 0; }
.option:has(input:checked) {
    border-color: var(--primary);
    background: var(--accent-bg);
    box-shadow: inset 0 0 0 1px var(--primary);
}
.option-label {
    font-weight: 600;
    font-size: 1.02rem;
    display: flex; align-items: center; gap: 12px;
}
.option-label::before {
    content: "";
    width: 20px; height: 20px;
    border: 2px solid var(--muted);
    border-radius: 50%;
    flex-shrink: 0;
    transition: border-color 140ms ease, background 140ms ease;
}
.option:has(input:checked) .option-label::before {
    border-color: var(--primary);
    background: radial-gradient(circle, var(--primary) 0 40%, transparent 45%);
}

/* Nav buttons */
.poem-nav {
    display: flex; justify-content: space-between; gap: 12px;
    margin-top: 32px;
}
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 46px; padding: 11px 22px;
    border-radius: var(--radius); border: 1px solid transparent;
    font-weight: 700; text-decoration: none;
    transition: background 160ms ease, transform 120ms ease;
    cursor: pointer; font-size: 1rem;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-h); }
.btn-secondary {
    color: var(--primary); background: var(--accent-bg);
    border-color: rgba(67,46,141,0.14);
}
.btn-secondary:hover:not(:disabled) { background: #e8e2f8; }
.btn-lg { min-height: 52px; padding: 14px 28px; font-size: 1.02rem; }

/* Result */
.score-block {
    text-align: center;
    padding: 32px 24px;
    margin: 24px 0;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
}
.score-num {
    font-size: clamp(3rem, 10vw, 4.5rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--primary);
}
.score-max { font-size: 1.4rem; font-weight: 700; color: var(--muted); }
.score-band {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 18px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
}
.score-desc { margin: 14px 0 0; color: var(--muted); }

.disclaimer {
    padding: 16px 18px;
    border-radius: var(--radius);
    background: #fff8e8;
    border: 1px solid #f0e2b8;
    color: #7a5c1e;
    font-size: 0.92rem;
}
.disclaimer p { margin: 0; }
.disclaimer strong { display: block; margin-bottom: 4px; }

.cta-box {
    margin-top: 24px;
    padding: 28px 24px;
    text-align: center;
    border-radius: var(--radius);
    background: var(--primary-dark);
    color: #fff;
}
.cta-box h2 { margin: 0 0 10px; font-size: 1.3rem; letter-spacing: -0.01em; }
.cta-box p { margin: 0 0 20px; color: rgba(255,255,255,0.85); }
.cta-box .btn-primary { background: var(--accent); }
.cta-box .btn-primary:hover { background: #8a6bff; }

.retake { text-align: center; margin: 20px 0 0; font-size: 0.9rem; }
.retake a { color: var(--accent); text-decoration: none; }
.retake a:hover { text-decoration: underline; }

@media (max-width: 480px) {
    .poem-header-inner, .poem-main { width: min(100% - 24px, var(--max)); }
    .poem-card { padding: 24px 20px; }
    .poem-nav { flex-direction: column; }
    .poem-nav .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
