/* =============================================================
   Numerología de la Compatibilidad — Styles
   Palette: teal / emerald / warm gold accents
   ============================================================= */

:root {
    --bg-dark:      #080d0d;
    --bg-card:      #101a1a;
    --bg-input:     #162222;
    --teal:         #14b8a6;
    --teal-soft:    #5eead4;
    --emerald:      #10b981;
    --gold:         #f5c542;
    --gold-soft:    #ffe08a;
    --text-primary: #e4f0ee;
    --text-muted:   #8aaba6;
    --border:       rgba(20,184,166,.18);
    --glow-teal:    rgba(20,184,166,.25);
    --glow-emerald: rgba(16,185,129,.20);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed; inset: 0;
    background:
        radial-gradient(ellipse 600px 600px at 30% 20%, rgba(20,184,166,.06), transparent),
        radial-gradient(ellipse 500px 500px at 70% 85%, rgba(16,185,129,.04), transparent);
    pointer-events: none;
    z-index: 0;
}

.numerology-container {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

/* ── Hero ──────────────────────────────────────────────── */
.hero-section {
    text-align: center;
    margin-bottom: 44px;
    animation: fadeInDown .8s ease;
}

.hero-symbol {
    width: 90px;
    height: 90px;
    margin: 0 auto 18px;
    color: var(--teal-soft);
    opacity: .7;
    animation: pulse-glow 4s ease-in-out infinite;
}

.app-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.4em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--teal-soft), var(--emerald));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    line-height: 1.25;
    text-align: center;
    display: block;
}

.title-ornament {
    -webkit-text-fill-color: var(--teal-soft);
    opacity: .6;
    display: block;
    font-size: .5em;
    line-height: 1;
    margin: 4px 0;
}

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

/* ── Input Card ────────────────────────────────────────── */
.input-section {
    animation: fadeInUp .8s ease .2s both;
}

.input-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px 28px;
    box-shadow: 0 8px 32px rgba(0,0,0,.3);
}

.persons-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: end;
    margin-bottom: 24px;
}

.person-group { display: flex; flex-direction: column; }

.person-label {
    display: block;
    color: var(--text-muted);
    font-size: .85em;
    margin-bottom: 8px;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.name-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1em;
    font-family: inherit;
    transition: border-color .3s, box-shadow .3s;
}

.name-input::placeholder { color: rgba(138,171,166,.35); }

.name-input:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--glow-teal);
}

.vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 8px;
}

.vs-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.4em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--teal-soft), var(--emerald));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Calculate button ──────────────────────────────────── */
.calculate-btn {
    display: block;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--teal), var(--emerald));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.08em;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: .03em;
    transition: transform .2s, box-shadow .3s;
    box-shadow: 0 4px 20px var(--glow-teal);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px var(--glow-teal);
}

.calculate-btn:active { transform: translateY(0); }

.calculate-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ── Error ─────────────────────────────────────────────── */
.error-message {
    background: rgba(239,68,68,.12);
    border: 1px solid rgba(239,68,68,.25);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    text-align: center;
    font-size: .93em;
    display: none;
}

.error-message.visible { display: block; animation: fadeIn .3s ease; }

/* ── Result ────────────────────────────────────────────── */
.result-section {
    display: none;
    margin-top: 32px;
    animation: fadeInUp .6s ease;
}

.result-section.visible { display: block; }

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px 28px;
    box-shadow: 0 8px 32px rgba(0,0,0,.3);
    text-align: center;
}

.result-label {
    font-size: .88em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 20px;
}

/* ── Compatibility display: two numbers with connector ─── */
.compat-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.person-result {
    text-align: center;
}

.person-name {
    font-size: .82em;
    color: var(--text-muted);
    margin-bottom: 4px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.person-number {
    font-family: 'Playfair Display', serif;
    font-size: 3.6em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--teal-soft), var(--emerald));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    animation: number-reveal .8s ease;
}

.compat-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.connector-line {
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--teal), var(--emerald));
    opacity: .5;
}

.connector-heart {
    font-size: 1.4em;
    opacity: .7;
}

/* ── Percentage ring ───────────────────────────────────── */
.compat-percentage-wrap {
    margin: 20px auto;
    width: 140px;
    height: 140px;
    position: relative;
}

.compat-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.compat-ring-bg {
    fill: none;
    stroke: rgba(20,184,166,.1);
    stroke-width: 8;
}

.compat-ring-fill {
    fill: none;
    stroke: url(#teal-gradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 377;
    stroke-dashoffset: 377;
    transition: stroke-dashoffset 1.5s ease;
}

.compat-percentage-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-size: 2em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--teal-soft), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.compat-level-label {
    font-size: .85em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-top: 8px;
}

/* ── Calculation detail ────────────────────────────────── */
.calculation-steps {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: left;
}

.steps-title {
    font-size: .85em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 14px;
    text-align: center;
}

.step-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: .92em;
}

.step-row:nth-child(even) { background: rgba(20,184,166,.04); }

.step-label { color: var(--text-muted); }

.step-value {
    font-weight: 600;
    color: var(--teal-soft);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.step-row.total {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-weight: 700;
}

.step-row.total .step-value { color: var(--emerald); font-size: 1.1em; }

/* ── Interpretation ────────────────────────────────────── */
.interpretation-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: left;
}

.interp-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.3em;
    color: var(--emerald);
    margin-bottom: 12px;
    text-align: center;
}

.interp-text {
    color: var(--text-muted);
    font-size: .97em;
    line-height: 1.8;
    text-align: justify;
}

.no-interp-text {
    color: var(--text-muted);
    font-size: .9em;
    text-align: center;
    font-style: italic;
    opacity: .7;
    margin-top: 16px;
}

/* ── New query button ──────────────────────────────────── */
.new-query-btn {
    display: block;
    width: 100%;
    margin-top: 28px;
    padding: 14px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: .95em;
    font-family: inherit;
    cursor: pointer;
    transition: border-color .3s, color .3s;
}

.new-query-btn:hover {
    border-color: var(--teal);
    color: var(--teal-soft);
}

/* ── Loading overlay ───────────────────────────────────── */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8,13,13,.85);
    z-index: 100;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 18px;
}

.loading-overlay.visible { display: flex; }

.loading-orb {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--teal-soft), var(--emerald));
    animation: orb-pulse 1.4s ease-in-out infinite;
}

.loading-text {
    color: var(--text-muted);
    font-size: .95em;
    letter-spacing: .04em;
}

/* ── Animations ────────────────────────────────────────── */
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
@keyframes fadeInDown { from{opacity:0;transform:translateY(-18px)} to{opacity:1;transform:translateY(0)} }
@keyframes fadeInUp { from{opacity:0;transform:translateY(18px)} to{opacity:1;transform:translateY(0)} }
@keyframes pulse-glow { 0%,100%{opacity:.5;transform:scale(1)} 50%{opacity:.8;transform:scale(1.06)} }
@keyframes orb-pulse { 0%,100%{transform:scale(.85);opacity:.6} 50%{transform:scale(1.15);opacity:1} }
@keyframes number-reveal { from{opacity:0;transform:scale(.5)} to{opacity:1;transform:scale(1)} }

/* ── Responsive ────────────────────────────────────────── */
@media(max-width:600px){
    .numerology-container { padding: 28px 14px 48px; }
    .app-title { font-size: 1.7em; }
    .input-card { padding: 24px 18px; }
    .persons-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .vs-divider { padding: 4px 0; }
    .person-number { font-size: 2.8em; }
    .compat-percentage-wrap { width: 120px; height: 120px; }
    .compat-percentage-text { font-size: 1.6em; }
}
