:root {
    --bg-1: #fdf6f1;
    --bg-2: #f7e6ea;
    --bg-3: #f3d9e4;
    --ink: #2b2030;
    --ink-soft: #6b5d6e;
    --accent: #c94f5b;
    --accent-deep: #8e2a34;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
        "PingFang SC", "Helvetica Neue", Helvetica, "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(1200px 800px at 15% 10%, #ffe9ec 0%, transparent 60%),
        radial-gradient(1000px 700px at 85% 90%, #ffd9e1 0%, transparent 55%),
        linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 55%, var(--bg-3) 100%);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex; flex-direction: column;
    overflow-x: hidden;
}

.topbar {
    position: fixed; top: 0; left: 0; right: 0;
    display: flex; align-items: center; justify-content: flex-start;
    padding: 14px 22px;
    font-size: 0.85rem; letter-spacing: 0.08em;
    color: var(--ink-soft);
    z-index: 10;
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    background: rgba(255, 250, 247, 0.45);
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); }
.brand .heart { color: var(--accent); font-size: 0.95rem; }

.hearts { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.hearts span {
    position: absolute; bottom: -24px;
    color: rgba(201,79,91,0.5);
    font-size: 14px;
    animation: rise linear infinite;
    opacity: 0;
}
@keyframes rise {
    0%   { transform: translateY(0) scale(0.9); opacity: 0; }
    10%  { opacity: 0.75; }
    100% { transform: translateY(-110vh) scale(1.1); opacity: 0; }
}

.stage {
    flex: 1;
    display: flex; align-items: center; justify-content: center;
    padding: 110px 22px 60px;
    position: relative;
    z-index: 2;
}

.auth-card {
    width: min(420px, 92vw);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255,255,255,0.6);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-radius: 20px;
    padding: 40px 34px 30px;
    box-shadow:
        0 30px 60px -20px rgba(138, 30, 40, 0.18),
        0 12px 30px -12px rgba(40, 20, 30, 0.12),
        0 1px 0 rgba(255,255,255,0.9) inset;
    animation: cardIn .7s cubic-bezier(.2,.8,.2,1) both;
    text-align: center;
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
.auth-card.shake {
    animation: shake .5s cubic-bezier(.36,.07,.19,.97);
}
@keyframes shake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}

.auth-eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.24em;
    color: var(--ink-soft);
    text-transform: uppercase;
    margin: 0 0 8px;
}
.auth-title {
    font-size: 1.45rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    margin: 0 0 6px;
}
.auth-sub {
    font-size: 0.88rem;
    color: var(--ink-soft);
    margin: 0 0 22px;
}

.question {
    font-size: 1.02rem;
    color: var(--ink);
    margin: 8px 0 20px;
    padding: 16px 18px;
    background: rgba(201,79,91,0.06);
    border: 1px dashed rgba(201,79,91,0.25);
    border-radius: 12px;
    line-height: 1.6;
}
.question .mark {
    color: var(--accent);
    font-weight: 500;
    margin-right: 4px;
}

.form-error {
    background: rgba(201,79,91,0.08);
    color: var(--accent-deep);
    border: 1px solid rgba(201,79,91,0.22);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 14px;
    display: none;
}
.form-error.show { display: block; }

input.answer-input {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.9);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--ink);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
    font-family: inherit;
    text-align: center;
    letter-spacing: 0.05em;
}
input.answer-input::placeholder { color: #b9adb4; }
input.answer-input:focus {
    outline: none;
    border-color: rgba(201,79,91,0.55);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(201,79,91,0.12);
}

.auth-btn {
    width: 100%;
    padding: 13px 18px;
    margin-top: 14px;
    color: #fff;
    font-size: 0.98rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    background: linear-gradient(180deg, #d65a66 0%, var(--accent) 60%, var(--accent-deep) 100%);
    box-shadow:
        0 10px 24px -10px rgba(201,79,91,0.6),
        0 1px 0 rgba(255,255,255,0.4) inset;
    transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
    font-family: inherit;
}
.auth-btn:hover  { transform: translateY(-1px); filter: brightness(1.04); }
.auth-btn:active { transform: translateY(0); filter: brightness(0.98); }
.auth-btn[disabled] { opacity: 0.6; cursor: wait; }

.auth-foot {
    margin-top: 18px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
