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

:root {
    --coral: #FF9B9B;
    --turquoise: #9BC4CB;
    --purple: #B39CC3;
    --purple-dark: #8B7A9C;
    --cream: #FFF5F0;
    --dark: #3D3446;
    --text-light: #6B5D73;
    --white-card: rgba(255, 255, 255, 0.92);
    --border: rgba(179, 156, 195, 0.25);
}

body {
    font-family: 'Karla', sans-serif;
    background: linear-gradient(180deg, var(--cream) 0%, #FFE8E8 35%, #E8F4F8 65%, #F0E8F8 100%);
    min-height: 100vh;
    color: var(--dark);
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: -50%;
    background:
    radial-gradient(circle at 20% 30%, rgba(255,155,155,.15), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(155,196,203,.15), transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(179,156,195,.12), transparent 50%);
    z-index: 0;
    pointer-events: none;
}

.star {
    position: fixed;
    font-size: 12px;
    opacity: .6;
    animation: twinkle 3s ease-in-out infinite;
    z-index: 1;
}

@keyframes twinkle {
    0%, 100% { opacity: .3; transform: scale(1); }
    50% { opacity: .8; transform: scale(1.2); }
}

main {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    padding: 5rem 1.5rem 3rem;
}

/* Header */
.page-header {
    text-align: center;
    margin-bottom: 2.5rem;
    animation: fadeUp 0.7s ease both;
}

.eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    color: var(--purple-dark);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.page-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 700;
    color: var(--dark);
    line-height: 1.15;
    margin-bottom: 1rem;
}

.page-header h1 em {
    font-style: italic;
    background: linear-gradient(135deg, var(--coral), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    color: var(--text-light);
    font-size: 1.05rem;
    max-width: 440px;
    margin: 0 auto;
    line-height: 1.7;
    font-weight: 300;
}

.ornament {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    max-width: 200px;
    margin: 1.2rem auto;
}

.ornament-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(179,156,195,0.5));
}

.ornament-line:last-child {
    background: linear-gradient(to left, transparent, rgba(179,156,195,0.5));
}

.ornament-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--purple);
    flex-shrink: 0;
}

/* Info banner */
.info-banner {
    background: var(--white-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.4rem 1.8rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    box-shadow: 0 6px 20px rgba(139,122,156,0.1);
    position: relative;
    overflow: hidden;
}

.info-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--coral), var(--purple), var(--turquoise));
}

.info-banner .icon { font-size: 1.5rem; flex-shrink: 0; margin-top: 2px; }

.info-banner h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: var(--dark);
    margin-bottom: 0.35rem;
}

.info-banner p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* Form card */
.form-card {
    background: var(--white-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 28px rgba(139,122,156,0.1);
    position: relative;
    overflow: hidden;
}

.form-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--coral), var(--purple), var(--turquoise));
    background-size: 200% 100%;
    animation: shimmerLine 4s linear infinite;
}

@keyframes shimmerLine {
    0%   { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.form-card h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    color: var(--dark);
    margin-bottom: 1.6rem;
    text-align: center;
}

.fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    margin-bottom: 1.4rem;
}

@media (max-width: 540px) {
    .fields-row { grid-template-columns: 1fr; }
}

.field-group label {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.field-group input {
    width: 100%;
    background: rgba(255,255,255,0.7);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 0.75rem 1rem;
    color: var(--dark);
    font-family: 'Karla', sans-serif;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    color-scheme: light;
    -webkit-appearance: none;
    appearance: none;
    min-height: 48px;
}

.field-group input:focus {
    border-color: rgba(179,156,195,0.7);
    box-shadow: 0 0 0 3px rgba(179,156,195,0.12);
}

.hora-nota {
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 1.4rem;
    font-style: italic;
}

/* ── CTA button ── */
.btn-analyze {
    width: 100%;
    font-family: 'Karla', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.4px;
    padding: 15px 2rem;
    border-radius: 18px;
    border: none;
    cursor: pointer;
    min-height: 52px;
    touch-action: manipulation;
    color: #fff;
    background: linear-gradient(135deg, #F7A7A7 0%, var(--purple) 55%, #9BC4CB 100%);
    box-shadow: 0 6px 22px rgba(179, 156, 195, 0.35);
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.btn-analyze::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.18), transparent 60%);
    border-radius: inherit;
    pointer-events: none;
}

.btn-analyze::after {
    content: '';
    position: absolute;
    top: 0; left: -75%;
    width: 50%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.22), transparent);
    transform: skewX(-20deg);
    transition: left 0.55s ease;
    pointer-events: none;
}

.btn-analyze:hover::after { left: 130%; }

.btn-analyze:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(179, 156, 195, 0.45);
    filter: brightness(1.04);
}

.btn-analyze:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(179, 156, 195, 0.25);
}

.btn-analyze:disabled {
    background: #ddd;
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
}

.error-msg {
    color: #c06060;
    text-align: center;
    font-size: 0.9rem;
    margin-top: 0.8rem;
    font-style: italic;
    min-height: 1.2rem;
}

/* Result */
#results {
    display: none;
    animation: fadeUp 0.6s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-hero {
    text-align: center;
    background: var(--white-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 12px 36px rgba(139,122,156,0.14);
    position: relative;
    overflow: hidden;
}

.result-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--coral), var(--purple), var(--turquoise));
    background-size: 200% 100%;
    animation: shimmerLine 4s linear infinite;
}

.result-hero::after {
    content: '';
    position: absolute;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(179,156,195,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.moon-big {
    font-size: 4.5rem;
    display: block;
    margin-bottom: 0.8rem;
    animation: moonPulse 3s ease-in-out infinite;
}

@keyframes moonPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(179,156,195,0.4)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 20px rgba(255,155,155,0.5)); }
}

.result-eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--purple-dark);
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.result-sign-name {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--coral), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.3rem;
}

.result-sign-icon {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.result-tagline {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.15rem;
    color: var(--text-light);
    max-width: 480px;
    margin: 0 auto;
}

/* Info tiles */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.info-tile {
    background: var(--white-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.3rem;
    box-shadow: 0 6px 20px rgba(139,122,156,0.08);
}

.info-tile .tile-label {
    font-size: 0.68rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--purple-dark);
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.info-tile .tile-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    color: var(--dark);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.info-tile .tile-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.55;
}

/* Desc cards */
.desc-card {
    background: var(--white-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.8rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 6px 20px rgba(139,122,156,0.1);
}

.desc-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    color: var(--dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.desc-card p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.75;
    margin-bottom: 0.8rem;
}

.desc-card p:last-child { margin-bottom: 0; }

/* Traits */
.traits-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.trait-pill {
    background: rgba(179,156,195,0.12);
    border: 1px solid rgba(179,156,195,0.35);
    border-radius: 50px;
    padding: 0.3rem 0.9rem;
    font-size: 0.82rem;
    color: var(--purple-dark);
    font-weight: 600;
}

/* Educational section */
.edu-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.edu-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: var(--dark);
    text-align: center;
    margin-bottom: 0.5rem;
}

.edu-section .subtitle {
    text-align: center;
    color: var(--text-light);
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.05rem;
    margin-bottom: 2rem;
}

.edu-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.edu-card {
    background: var(--white-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 6px 20px rgba(139,122,156,0.08);
    transition: box-shadow 0.2s, transform 0.2s;
}

.edu-card:hover {
    box-shadow: 0 10px 28px rgba(139,122,156,0.16);
    transform: translateY(-2px);
}

.edu-card .edu-icon { font-size: 1.8rem; margin-bottom: 0.7rem; }

.edu-card h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.edu-card p {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.65;
}

/* Table */
.diff-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
}

.diff-table th {
    text-align: left;
    padding: 0.7rem 1rem;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--purple-dark);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.diff-table td {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
    border-bottom: 1px solid rgba(179,156,195,0.1);
    vertical-align: top;
}

.diff-table tr:last-child td { border-bottom: none; }

.diff-table td:first-child {
    color: var(--dark);
    font-weight: 600;
    white-space: nowrap;
}

/* ── Reset button ── */
.btn-reset {
    display: block;
    margin: 1.5rem auto 0;
    font-family: 'Karla', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
    padding: 12px 28px;
    border-radius: 16px;
    border: 1.5px solid rgba(179, 156, 195, 0.4);
    background: rgba(255, 255, 255, 0.88);
    color: var(--purple-dark);
    cursor: pointer;
    min-height: 48px;
    touch-action: manipulation;
    box-shadow: 0 4px 12px rgba(179, 156, 195, 0.08);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.btn-reset:hover {
    transform: translateY(-2px);
    background: #fff;
    border-color: var(--purple);
    box-shadow: 0 8px 20px rgba(179, 156, 195, 0.18);
}

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

/* ── Nav buttons ── */
.actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 0 1.5rem 32px;
    position: relative;
    z-index: 2;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 13px 24px;
    margin-top: 32px;
    border-radius: 16px;
    font-family: 'Karla', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-decoration: none;
    text-align: center;
    transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

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

.btn-primary {
    background: linear-gradient(135deg, #F7A7A7 0%, var(--purple) 55%, #9BC4CB 100%);
    color: #fff;
    border: none;
    box-shadow: 0 6px 20px rgba(179, 156, 195, 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.18), transparent 60%);
    border-radius: inherit;
    pointer-events: none;
}

.btn-primary:hover {
    box-shadow: 0 10px 28px rgba(179, 156, 195, 0.42);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: var(--purple-dark);
    border: 1.5px solid rgba(179, 156, 195, 0.4);
    box-shadow: 0 4px 12px rgba(179, 156, 195, 0.08);
}

.btn-secondary:hover {
    background: #fff;
    border-color: var(--purple);
    box-shadow: 0 8px 20px rgba(179, 156, 195, 0.18);
    filter: none;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    position: relative;
    z-index: 2;
}

.footer-links {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--purple-dark);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-link:hover { color: var(--coral); }

.copyright {
    font-size: 14px;
    opacity: 0.8;
}

/* Mobile */
@media (max-width: 640px) {
    main { padding: 4rem 1rem 2.5rem; }

    .actions {
        flex-direction: column;
        align-items: stretch;
        padding: 0 1rem 28px;
    }

    .btn { justify-content: center; width: 100%; }
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-scroll::-webkit-scrollbar { height: 6px; }

.table-scroll::-webkit-scrollbar-thumb {
    background: rgba(179,156,195,0.4);
    border-radius: 4px;
}

.table-scroll::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 640px) {
    .diff-table { min-width: 480px; }

    .table-scroll::after {
        content: '← Deslizá →';
        display: block;
        text-align: center;
        font-size: 0.75rem;
        color: var(--text-light);
        margin-top: 0.5rem;
        font-style: italic;
    }
}