:root,
[data-theme="light"] {
    --bg: #f3f6f5;
    --bg-deep: #e8eeec;
    --surface: #ffffff;
    --fg: #15201e;
    --muted: #5c6b67;
    --line: #d2ddd9;
    --field-bg: #ffffff;
    --field-border: #c3d0cb;
    --field-focus: #0f766e;
    --accent: #0f766e;
    --accent-hover: #0d665f;
    --accent-fg: #ffffff;
    --error: #b42318;
    --shadow: 0 1px 2px rgba(21, 32, 30, 0.04), 0 8px 24px rgba(21, 32, 30, 0.05);
    --glow: radial-gradient(ellipse 80% 50% at 8% -8%, rgba(15, 118, 110, 0.14), transparent 55%),
            radial-gradient(ellipse 55% 40% at 100% 0%, rgba(15, 118, 110, 0.06), transparent 50%);
}

[data-theme="dark"] {
    --bg: #12110f;
    --bg-deep: #0c0b0a;
    --surface: #1c1a17;
    --fg: #f3efe7;
    --muted: #a39e94;
    --line: #2e2b26;
    --field-bg: #1c1a17;
    --field-border: #3d3932;
    --field-focus: #2dd4bf;
    --accent: #2dd4bf;
    --accent-hover: #5eead4;
    --accent-fg: #0c0b0a;
    --error: #f87171;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 12px 32px rgba(0, 0, 0, 0.28);
    --glow: radial-gradient(ellipse 80% 50% at 10% -10%, rgba(45, 212, 191, 0.1), transparent 55%),
            radial-gradient(ellipse 60% 40% at 100% 0%, rgba(180, 140, 80, 0.06), transparent 50%);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 1.75rem clamp(1.25rem, 5vw, 3rem) 2.5rem;
    min-height: 100vh;
    background-color: var(--bg);
    background-image: var(--glow), linear-gradient(165deg, var(--bg) 0%, var(--bg-deep) 100%);
    background-attachment: fixed;
    color: var(--fg);
    font-family: "Instrument Sans", "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.skip {
    position: absolute;
    left: 1rem;
    top: -4rem;
    padding: 0.5rem 0.9rem;
    border-radius: 6px;
    background: var(--fg);
    color: var(--bg);
    font-size: 0.875rem;
    text-decoration: none;
    z-index: 10;
}
.skip:focus { top: 1rem; }

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 40rem;
    margin: 0 auto;
}

.wordmark {
    color: inherit;
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(1.15rem, 2.5vw, 1.35rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-decoration: none;
}
a.wordmark { color: inherit; text-decoration: none; }

.top-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--fg);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.theme-toggle svg {
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.lang {
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-decoration: none;
    transition: color 0.2s;
}
.lang:hover { color: var(--fg); }

main {
    width: 100%;
    max-width: 40rem;
    margin: 0 auto;
}

.hero {
    min-height: calc(100vh - 6rem);
    min-height: calc(100dvh - 6rem);
    display: flex;
    flex-direction: column;
    padding-top: clamp(2rem, 8vh, 5rem);
}
.hero-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-bottom: 3rem;
    animation: rise 0.55s ease both;
}

h1 {
    margin: 0 0 1.25rem;
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(2.15rem, 6.2vw, 3.35rem);
    font-weight: 500;
    line-height: 1.12;
    letter-spacing: -0.03em;
    text-wrap: balance;
}
h1 span { display: block; color: var(--muted); font-weight: 500; }

.lead {
    margin: 0 0 2.25rem;
    max-width: 34rem;
    color: var(--muted);
    font-size: 1.0625rem;
    line-height: 1.65;
}

.open {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    border: 0;
    border-bottom: 1px solid var(--fg);
    background: none;
    color: var(--fg);
    font: inherit;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.open:hover { color: var(--accent); border-color: var(--accent); }
.open .arrow { transition: transform 0.2s; }
.open:hover .arrow { transform: translateX(3px); }

/* Formulario */
form {
    display: grid;
    gap: 1.15rem;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
    animation: rise 0.65s ease 0.08s both;
}
form[hidden] { display: none; }

.form-title {
    margin: 0 0 0.15rem;
    font-family: Fraunces, Georgia, serif;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.field {
    display: grid;
    gap: 0.4rem;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

label {
    display: block;
    color: var(--fg);
    font-size: 0.875rem;
    font-weight: 500;
}

input, textarea {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--field-border);
    border-radius: 8px;
    background: var(--field-bg);
    color: var(--fg);
    font: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}
textarea { resize: vertical; min-height: 7.5rem; }
input::placeholder,
textarea::placeholder {
    color: var(--muted);
    opacity: 0.85;
}
input:hover, textarea:hover { border-color: var(--muted); }
input:focus, textarea:focus {
    outline: none;
    border-color: var(--field-focus);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--field-focus) 22%, transparent);
}
input[aria-invalid="true"], textarea[aria-invalid="true"] {
    border-color: var(--error);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--error) 18%, transparent);
}

.trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.25rem;
}

.send {
    padding: 0.75rem 1.4rem;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: var(--accent-fg);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.send:hover { background: var(--accent-hover); }
.send:active { transform: translateY(1px); }
.send:disabled { opacity: 0.55; cursor: default; transform: none; }

.status {
    margin: 0;
    font-size: 0.875rem;
    color: var(--muted);
}
.status.error { color: var(--error); }

.done {
    margin: 0;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
    animation: rise 0.35s ease both;
}
.done[hidden] { display: none; }
.done-title {
    margin: 0 0 0.75rem;
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 600;
    letter-spacing: -0.02em;
}
.done-body {
    margin: 0;
    max-width: 28rem;
    color: var(--muted);
    font-size: 1.0625rem;
}

.stacks { animation: rise 0.7s ease 0.12s both; }

.stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 0.8125rem;
}
.stack + .stack { margin-top: 0.75rem; }
.stack .label { color: var(--fg); font-weight: 500; }

.block {
    padding-block: 3rem;
    border-top: 1px solid var(--line);
}
.block h2 {
    margin: 0 0 1.5rem;
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.plain {
    display: grid;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.plain strong {
    display: block;
    margin-bottom: 0.2rem;
    font-family: Fraunces, Georgia, serif;
    font-weight: 600;
}
.plain span { color: var(--muted); }

.steps {
    display: grid;
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}
.steps li {
    display: grid;
    grid-template-columns: 2.25rem 1fr;
    counter-increment: step;
}
.steps li::before {
    content: counter(step, decimal-leading-zero);
    padding-top: 0.2rem;
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 500;
}
.steps strong {
    display: block;
    font-family: Fraunces, Georgia, serif;
    font-weight: 600;
}
.steps span { color: var(--muted); }

details {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
}
details:first-of-type { border-top: 1px solid var(--line); }
summary {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-weight: 500;
    list-style: none;
    cursor: pointer;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--muted); }
details[open] summary::after { content: "\2013"; }
details p { margin: 0.6rem 0 0; color: var(--muted); }

.closing { padding-block: 2.5rem 1rem; }

.copy {
    margin: 2rem 0 0;
    color: var(--muted);
    font-size: 0.75rem;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

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