/* ============================================================
   CSS VARIABLES — Romantic Pink-Purple Palette
   ============================================================ */
:root {
    --bg: #1a0d1f;
    --surface: #241030;
    --card: rgba(40, 18, 55, 0.88);
    --border: rgba(255, 120, 180, 0.15);
    --glow: #ff6eb4;
    --glow-rgb: 255, 110, 180;
    --accent: #f9a8d4;
    --pink: #ff6eb4;
    --pink-light: #ffb3d9;
    --purple: #c084fc;
    --purple-dark: #7c3aed;
    --gold: #f5c2e7;
    --gold-light: #fce7f3;
    --text: #fce7f3;
    --muted: #9d8aaa;
    --font-display: 'Playfair Display', serif;
    --font-body: 'Lora', serif;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem 1rem 4rem;
    position: relative;
    overflow-x: hidden;
}

/* ============================================================
   BACKGROUND — Floating Hearts Canvas
   ============================================================ */
#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* Radial gradient overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 70% 50% at 20% 20%, rgba(192, 132, 252, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(255, 110, 180, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 40% 60% at 50% 50%, rgba(124, 58, 237, 0.10) 0%, transparent 70%);
    pointer-events: none;
}

/* ============================================================
   SECTION SYSTEM
   ============================================================ */
.section {
    display: none;
    width: 100%;
    max-width: 540px;
    position: relative;
    z-index: 10;
}

.section.active {
    display: block;
    animation: sectionIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.section.leaving {
    animation: sectionOut 0.34s ease forwards;
}

@keyframes sectionIn {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

/* ============================================================
   CARD
   ============================================================ */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    padding: 2.75rem 2.25rem;
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    box-shadow:
        0 0 90px rgba(var(--glow-rgb), 0.08),
        0 2px 60px rgba(0, 0, 0, 0.65),
        inset 0 1px 0 rgba(var(--glow-rgb), 0.10);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 10%, rgba(var(--glow-rgb), 0.55) 50%, transparent 90%);
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.t-display {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.15;
}

.t-subtitle {
    font-family: var(--font-body);
    font-weight: 300;
    font-style: italic;
    color: var(--accent);
    font-size: 1.05rem;
    opacity: 0.85;
}

.t-body {
    font-family: var(--font-body);
    font-weight: 300;
    color: rgba(252, 231, 243, 0.78);
    line-height: 1.75;
    font-size: 0.97rem;
}

.t-label {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.6rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--muted);
    opacity: 0.6;
}

.t-muted-italic {
    font-family: var(--font-body);
    font-style: italic;
    font-weight: 300;
    color: var(--muted);
    font-size: 0.9rem;
}

/* ============================================================
   RUNE DIVIDER
   ============================================================ */
.rune-divider {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1.5rem 0;
}

.rune-divider::before,
.rune-divider::after {
    content: '';
    flex: 1;
    height: 1px;
}

.rune-divider::before {
    background: linear-gradient(90deg, transparent, rgba(var(--glow-rgb), 0.35));
}

.rune-divider::after {
    background: linear-gradient(90deg, rgba(var(--glow-rgb), 0.35), transparent);
}

.rune-divider span {
    font-family: var(--font-display);
    color: var(--accent);
    font-size: 1rem;
    opacity: 0.7;
}

/* ============================================================
   INPUT FIELDS
   ============================================================ */
.input-label {
    display: block;
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.55rem;
    opacity: 0.75;
}

.name-input,
.date-input {
    width: 100%;
    background: rgba(255, 110, 180, 0.05);
    border: 1px solid rgba(255, 110, 180, 0.2);
    border-radius: 0.9rem;
    padding: 1rem 1.3rem;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 300;
    font-style: italic;
    outline: none;
    transition: all 0.3s ease;
    -webkit-appearance: none;
}

.name-input::placeholder {
    color: rgba(var(--glow-rgb), 0.3);
}

.name-input:focus,
.date-input:focus {
    border-color: rgba(var(--glow-rgb), 0.55);
    background: rgba(255, 110, 180, 0.08);
    box-shadow: 0 0 0 3px rgba(var(--glow-rgb), 0.12);
}

input[type="date"] {
    color-scheme: dark;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-main {
    display: block;
    width: 100%;
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.1em;
    color: #1a0d1f;
    font-weight: 600;
    background: linear-gradient(135deg, #ff6eb4 0%, #c084fc 50%, #ff6eb4 100%);
    background-size: 200% 200%;
    border: none;
    border-radius: 0.9rem;
    padding: 1rem 2rem;
    cursor: pointer;
    transition: all 0.35s ease;
    box-shadow:
        0 0 28px rgba(var(--glow-rgb), 0.4),
        0 4px 24px rgba(0, 0, 0, 0.45);
    animation: gradShift 4s ease infinite;
}

@keyframes gradShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.btn-main:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 48px rgba(var(--glow-rgb), 0.65), 0 8px 32px rgba(0, 0, 0, 0.45);
}

.btn-ghost {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--accent);
    background: transparent;
    border: 1px solid rgba(var(--glow-rgb), 0.22);
    border-radius: 0.9rem;
    padding: 0.85rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.06em;
}

.btn-ghost:hover {
    background: rgba(var(--glow-rgb), 0.07);
    border-color: rgba(var(--glow-rgb), 0.45);
}

/* ============================================================
   ERROR MESSAGE
   ============================================================ */
.error-msg {
    display: none;
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.82rem;
    color: #ff8fab;
    margin-top: 0.5rem;
    padding-left: 0.25rem;
}

/* ============================================================
   SIGIL — Heart Sigil
   ============================================================ */
.sigil {
    width: 88px;
    height: 88px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.sigil-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(var(--glow-rgb), 0.2);
    animation: ringRotate 9s linear infinite;
}

.sigil-ring-2 {
    inset: -8px;
    border-style: dashed;
    border-color: rgba(192, 132, 252, 0.12);
    animation: ringRotate 14s linear infinite reverse;
}

/* ============================================================
   PROGRESS STEPS
   ============================================================ */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(var(--glow-rgb), 0.2);
    transition: all 0.4s ease;
}

.step-dot.active {
    background: var(--pink);
    box-shadow: 0 0 10px rgba(var(--glow-rgb), 0.7);
    width: 24px;
    border-radius: 4px;
}

.step-dot.done {
    background: rgba(var(--glow-rgb), 0.45);
}

/* ============================================================
   LOADING ANIMATION
   ============================================================ */
.loading-orb-wrap {
    width: 110px;
    height: 110px;
    margin: 0 auto;
    position: relative;
}

.orb-core {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 28%,
            rgba(var(--glow-rgb), 0.7),
            rgba(192, 132, 252, 0.35) 45%,
            transparent 70%);
    border: 1px solid rgba(var(--glow-rgb), 0.4);
    box-shadow:
        0 0 35px rgba(var(--glow-rgb), 0.55),
        0 0 80px rgba(var(--glow-rgb), 0.2);
    animation: orbPulse 2.2s ease-in-out infinite;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.orb-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(var(--glow-rgb), 0.15);
}

.orb-ring-1 {
    inset: -12px;
    animation: ringRotate 4s linear infinite;
}

.orb-ring-2 {
    inset: -24px;
    border-style: dashed;
    border-color: rgba(192, 132, 252, 0.08);
    animation: ringRotate 7s linear infinite reverse;
}

.orb-ring-3 {
    inset: -40px;
    border-color: rgba(var(--glow-rgb), 0.05);
    animation: ringRotate 12s linear infinite;
}

@keyframes orbPulse {
    0%, 100% { transform: scale(1); }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 55px rgba(var(--glow-rgb), 0.75), 0 0 110px rgba(var(--glow-rgb), 0.3);
    }
}

@keyframes ringRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-style: italic;
    color: var(--accent);
    font-size: 1.05rem;
    letter-spacing: 0.03em;
    min-height: 1.8em;
}

/* ============================================================
   RESULT — Love Score Display
   ============================================================ */
.love-score-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 190px;
    margin: 0.25rem 0;
}

.result-halo {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(var(--glow-rgb), 0.12);
}

.result-halo-1 {
    width: 150px;
    height: 150px;
    animation: ringRotate 9s linear infinite;
}

.result-halo-2 {
    width: 200px;
    height: 200px;
    border-style: dashed;
    border-color: rgba(192, 132, 252, 0.07);
    animation: ringRotate 16s linear infinite reverse;
}

.love-score {
    font-family: var(--font-display);
    font-size: clamp(4.5rem, 20vw, 7.5rem);
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, #ffb3d9 0%, #ff6eb4 40%, #c084fc 80%, #ffb3d9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: numGlow 2.8s ease-in-out infinite;
    position: relative;
    z-index: 3;
}

@keyframes numGlow {
    0%, 100% { filter: drop-shadow(0 0 18px rgba(var(--glow-rgb), 0.6)); }
    50% { filter: drop-shadow(0 0 40px rgba(var(--glow-rgb), 0.95)) drop-shadow(0 0 70px rgba(var(--glow-rgb), 0.4)); }
}

/* ============================================================
   COMPATIBILITY BAR
   ============================================================ */
.compat-bar-wrap {
    background: rgba(255, 110, 180, 0.08);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.compat-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #c084fc, #ff6eb4, #ffb3d9);
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 10px rgba(var(--glow-rgb), 0.5);
}

/* ============================================================
   ARCHETYPE BADGE
   ============================================================ */
.love-badge {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: var(--pink-light);
    background: rgba(255, 110, 180, 0.1);
    border: 1px solid rgba(255, 110, 180, 0.28);
    border-radius: 2rem;
    padding: 0.45rem 1.4rem;
}

/* ============================================================
   NAMES DISPLAY
   ============================================================ */
.names-display {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-style: italic;
    text-align: center;
    color: var(--accent);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* ============================================================
   INFO GRID (Life Path, Name Number, etc.)
   ============================================================ */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.info-card {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(var(--glow-rgb), 0.1);
    border-radius: 1rem;
    padding: 1rem 1.1rem;
    transition: border-color 0.3s ease, background 0.3s ease;
    text-align: center;
}

.info-card:hover {
    border-color: rgba(var(--glow-rgb), 0.28);
    background: rgba(var(--glow-rgb), 0.04);
}

.info-card-num {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    background: linear-gradient(135deg, #ff6eb4, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.info-card-label {
    font-family: var(--font-body);
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    opacity: 0.7;
    margin-top: 0.25rem;
}

.info-card-name {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.78rem;
    color: var(--accent);
    opacity: 0.7;
    margin-top: 0.15rem;
}

/* ============================================================
   RELATIONSHIP ENERGY
   ============================================================ */
.energy-card {
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.08), rgba(255, 110, 180, 0.08));
    border: 1px solid rgba(var(--glow-rgb), 0.15);
    border-radius: 1rem;
    padding: 1.1rem 1.4rem;
    text-align: center;
    margin-bottom: 1rem;
}

.energy-num {
    font-family: var(--font-display);
    font-size: 2.5rem;
    background: linear-gradient(135deg, #c084fc, #ff6eb4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

/* ============================================================
   TRAIT BLOCKS
   ============================================================ */
.trait-block {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(var(--glow-rgb), 0.09);
    border-radius: 1rem;
    padding: 1.15rem 1.4rem;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.trait-block:hover {
    border-color: rgba(var(--glow-rgb), 0.24);
    background: rgba(var(--glow-rgb), 0.04);
}

.trait-label {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.6rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.4rem;
    opacity: 0.65;
}

.trait-content {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.93rem;
    line-height: 1.7;
    color: rgba(252, 231, 243, 0.82);
}

/* ============================================================
   FLOATING HEARTS ANIMATION (CSS decorative)
   ============================================================ */
.float-heart {
    position: fixed;
    font-size: 1rem;
    opacity: 0;
    animation: floatUp linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes floatUp {
    0% { opacity: 0; transform: translateY(0) scale(0.8) rotate(-10deg); }
    10% { opacity: 0.5; }
    90% { opacity: 0.15; }
    100% { opacity: 0; transform: translateY(-100vh) scale(1.2) rotate(15deg); }
}

/* ============================================================
   PRIVACY NOTE
   ============================================================ */
.privacy-note {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.72rem;
    color: var(--muted);
    opacity: 0.45;
    text-align: center;
    margin-top: 1rem;
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
    body { padding: 1.25rem 0.75rem 3rem; }
    .card { padding: 2rem 1.5rem; }
    .info-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
}
