:root {
  /* Base */
  --night: #05060d;
  --surface: #0d1122;
  --surface-2: #131833;
  --text: #f2f4fc;
  --text-2: #aab2cf;
  --text-3: #7c84a6;
  --border: rgba(170, 178, 207, 0.14);
  --border-strong: rgba(170, 178, 207, 0.5);

  /* Acción y atmósfera */
  --action: #5b8cff;
  --solid: #4766e6;
  --nebula: #6b3cff;
  --rim: #b9a8ff;

  /* Estados */
  --ok: #34d399;
  --warn: #f5b14c;
  --danger: #ff7a8a;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-press: 120ms;
  --t-ui: 200ms;

  --font-display: Poppins, Inter, system-ui, sans-serif;
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  border: 0 solid var(--border);
}

html {
  scroll-padding-top: 80px;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--night);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  overflow-x: hidden;
}

main {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(91, 140, 255, 0.35);
}

.icon {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.icon-fill {
  fill: currentColor;
  stroke: none;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

@media (max-width: 640px) {
  .container { padding: 0 1rem; }
}

/* Cielo: estrellas finas y dos nebulosas suaves */

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 85% -10%, rgba(107, 60, 255, 0.16), transparent 70%),
    radial-gradient(50rem 36rem at -10% 40%, rgba(71, 102, 230, 0.12), transparent 70%),
    var(--night);
}

.sky::before,
.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: repeat;
}

.sky::before {
  background-image:
    radial-gradient(1px 1px at 23px 41px, rgba(242, 244, 252, 0.55), transparent 100%),
    radial-gradient(1px 1px at 131px 97px, rgba(242, 244, 252, 0.35), transparent 100%),
    radial-gradient(1px 1px at 187px 13px, rgba(242, 244, 252, 0.45), transparent 100%),
    radial-gradient(1px 1px at 71px 173px, rgba(242, 244, 252, 0.3), transparent 100%);
  background-size: 220px 220px;
}

.sky::after {
  background-image:
    radial-gradient(1.5px 1.5px at 97px 211px, rgba(185, 168, 255, 0.55), transparent 100%),
    radial-gradient(1px 1px at 283px 59px, rgba(242, 244, 252, 0.5), transparent 100%),
    radial-gradient(1px 1px at 337px 281px, rgba(242, 244, 252, 0.3), transparent 100%);
  background-size: 380px 380px;
}

/* Pantalla de arranque */

.splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: var(--night);
  transition: opacity 400ms var(--ease-out);
}

.splash-logo {
  width: 120px;
  height: auto;
  color: var(--text);
  fill: currentColor;
  fill-opacity: 0;
  stroke: currentColor;
  stroke-width: 0.9;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transform-origin: 0 0;
  animation: draw 900ms var(--ease-out) 100ms forwards, fill-in 300ms ease-out 850ms forwards;
}

.splash.fly {
  background: transparent;
  pointer-events: none;
  transition: background 300ms var(--ease-out);
}

.splash.fly .splash-logo {
  transition: transform 500ms var(--ease-out);
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

@keyframes fill-in {
  to { fill-opacity: 1; stroke-width: 0; }
}

/* Si el script no llega a cargar, la pantalla se quita sola */
.splash {
  animation: splash-timeout 0s 4s forwards;
}

@keyframes splash-timeout {
  to { visibility: hidden; }
}

html.splashing .header .logo-mark {
  opacity: 0;
}

html.splash-wait .enter {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .splash { display: none; }
}

/* Cabecera */

.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  padding: 1rem 0;
  border-bottom: 1px solid transparent;
  transition: background var(--t-ui), border-color var(--t-ui);
}

.header.scrolled {
  background: rgba(5, 6, 13, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.75rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  border-radius: 6px;
  color: var(--text);
  flex-shrink: 0;
}

.logo-mark {
  width: 34px;
  height: auto;
  fill: currentColor;
}

.logo-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  line-height: 1;
}


.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color var(--t-ui), background var(--t-ui);
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-link:focus-visible,
.back-link:focus-visible,
.link-btn:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}

/* Botones: principal, secundario y discreto */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.875rem;
  padding: 0 1.25rem;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-ui), border-color var(--t-ui), color var(--t-ui), transform var(--t-press) ease-out;
  -webkit-tap-highlight-color: transparent;
}

.btn:active:not([disabled]) {
  transform: scale(0.97);
}

.btn:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--solid);
  color: #fff;
}

.btn-primary:hover {
  background: #3f5ddc;
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: rgba(170, 178, 207, 0.7);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--surface);
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Entrada coordinada por pantalla */

.enter {
  animation: enter 500ms var(--ease-out) backwards;
  animation-delay: var(--delay, 0ms);
}

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

/* Inicio */

.section {
  position: relative;
  padding: 4rem 0;
}

.positions-page {
  padding: 8rem 0 2rem;
}

.section-title {
  margin-bottom: 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.section-sub {
  max-width: 36rem;
  margin-bottom: 2.5rem;
  font-size: 1.125rem;
  color: var(--text-2);
}

.card {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}

.positions-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .positions-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1100px) {
  .positions-grid { grid-template-columns: repeat(4, 1fr); }
}

.position {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border-top: 2px solid var(--role);
  transition: border-color var(--t-ui), background var(--t-ui);
}

.position:hover {
  background: var(--surface-2);
}

.position.closed {
  opacity: 0.6;
}

.position-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.role-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-sm);
  font-size: 1.375rem;
  color: var(--role);
  background: color-mix(in srgb, var(--role) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--role) 28%, transparent);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 500;
}

.status::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
}

.status-open { color: var(--ok); }
.status-closed { color: var(--text-3); }

.position h3 {
  margin-bottom: 0.4rem;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.position p {
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-2);
}

.position-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.25rem 0 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.position-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.position .btn {
  width: 100%;
}

.reqs {
  margin: 0 0 1rem;
  text-align: left;
}

.reqs-title {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.reqs ul {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reqs li {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-2);
}

.reqs li svg {
  flex: none;
  width: 0.95rem;
  height: 0.95rem;
  margin-top: 0.1rem;
  color: var(--role, var(--action));
}

.position .reqs {
  flex: 1;
}

/* Ayuda */

.help {
  padding: 2rem 0 3rem;
}

.help-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.help-row p {
  color: var(--text-2);
}

.help-row p a {
  color: var(--action);
}

.help-row p a:hover {
  text-decoration: underline;
}

/* Formulario */

.form-page {
  position: relative;
  padding: 7rem 0 3rem;
  min-height: 100vh;
}

.form-container {
  max-width: 46rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-2);
  border-radius: 6px;
  transition: color var(--t-ui);
}

.back-link:hover {
  color: var(--text);
}

.form-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
}

.form-header .role-icon {
  width: 3.25rem;
  height: 3.25rem;
  font-size: 1.5rem;
  border-radius: var(--radius);
}

.form-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.form-header > div > p {
  margin: 0.4rem 0 1rem;
  color: var(--text-2);
}

.stepper {
  margin-bottom: 1.5rem;
}

.stepper-labels {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  font-size: 0.8125rem;
}

.stepper-labels button {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 44px;
  min-height: 44px;
  color: var(--text-3);
  cursor: pointer;
  border-radius: 6px;
  transition: color var(--t-ui);
}

.stepper-labels button:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}

.stepper-labels button[disabled] {
  cursor: default;
}

.stepper-labels button.current {
  color: var(--text);
  font-weight: 600;
}

.stepper-labels button.done {
  color: var(--text-2);
}

.stepper-labels button.done:hover {
  color: var(--text);
}

.stepper-labels .num {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border-strong);
}

.stepper-labels button.current .num {
  color: var(--text);
  border-color: var(--action);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.2);
}

.stepper-labels button.done .num {
  color: var(--action);
  border-color: rgba(91, 140, 255, 0.4);
}

@media (max-width: 640px) {
  .stepper-labels .label { display: none; }
  .stepper-labels button.current .label { display: inline; }
}

.progress {
  height: 3px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--action);
  transition: width 240ms var(--ease-out);
}

.form-card {
  padding: 2rem;
}

@media (max-width: 640px) {
  .form-card { padding: 1.25rem; }
}

.form-step {
  animation: step-in 220ms var(--ease-out);
}

@keyframes step-in {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: none; }
}

.form-step h2 {
  margin: 0 0 1.5rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.field {
  margin-bottom: 1.5rem;
}

.field-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

.opt {
  font-weight: 400;
  color: var(--text-3);
}

.field-help {
  margin: -0.25rem 0 0.6rem;
  font-size: 0.8125rem;
  color: var(--text-3);
}

.field-link {
  color: var(--action);
  font-weight: 500;
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--night);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  transition: border-color var(--t-ui), box-shadow var(--t-ui);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-3);
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: rgba(170, 178, 207, 0.7);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--action);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.25);
}

.textarea {
  min-height: 8rem;
  resize: vertical;
  line-height: 1.6;
}

.select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aab2cf' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.1rem;
  cursor: pointer;
}

.select option {
  background: var(--surface);
}

.counter {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  text-align: right;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.counter.warn {
  color: var(--warn);
}

.options {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
}

.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.875rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--night);
  font-size: 0.9375rem;
  cursor: pointer;
  transition: border-color var(--t-ui), background var(--t-ui);
}

.option:hover {
  border-color: rgba(170, 178, 207, 0.7);
}

.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option .mark {
  display: grid;
  place-items: center;
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  border: 1.5px solid var(--text-3);
  border-radius: 5px;
  transition: background var(--t-ui), border-color var(--t-ui);
}

.option input[type="radio"] + .mark {
  border-radius: 50%;
}

.option .mark svg {
  width: 0.75rem;
  height: 0.75rem;
  stroke-width: 2.4;
  opacity: 0;
  transition: opacity var(--t-ui);
}

.option:has(input:checked) {
  border-color: var(--action);
  background: rgba(91, 140, 255, 0.08);
}

.option input:checked + .mark {
  background: var(--action);
  border-color: var(--action);
  color: var(--night);
}

.option input:checked + .mark svg {
  opacity: 1;
}

.option:has(input:focus-visible) {
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.3);
}

.scale {
  display: flex;
  gap: 0.5rem;
}

.scale .option {
  flex: 1;
  justify-content: center;
  padding: 0.7rem 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.scale .option .mark {
  display: none;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-3);
}

.field.invalid .input,
.field.invalid .textarea,
.field.invalid .select,
.field.invalid .option {
  border-color: rgba(255, 122, 138, 0.6);
}

.field-error {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.4rem;
  font-size: 0.8125rem;
  color: var(--danger);
}

.field-error:empty {
  display: none;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.form-actions .spacer {
  flex: 1;
}

.draft-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--text-3);
}

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

.spinner {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Confirmaciones finales */

.confirm {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.confirm h3 {
  margin: 0 0 0.375rem;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
}

.confirm-list {
  display: grid;
  margin-top: 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--night);
  overflow: hidden;
}

.confirm-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.125rem;
  cursor: pointer;
  transition: background var(--t-ui);
}

.confirm-item + .confirm-item {
  border-top: 1px solid var(--border);
}

.confirm-item:hover {
  background: rgba(170, 178, 207, 0.04);
}

.confirm-item:has(input:checked) {
  background: rgba(91, 140, 255, 0.06);
}

.confirm-item:has(input:focus-visible) {
  box-shadow: inset 0 0 0 2px var(--action);
}

.confirm-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.confirm-icon svg {
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.15rem;
  color: var(--text-3);
}

.confirm-item:has(input:checked) .confirm-icon svg {
  color: var(--action);
}

.confirm-body {
  display: grid;
  flex: 1;
  gap: 0.375rem;
  font-size: 0.875rem;
  line-height: 1.55;
}

.confirm-body strong {
  font-size: 0.9375rem;
  font-weight: 600;
}

.confirm-text {
  color: var(--text-2);
}

.confirm-item .mark {
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
  border: 1.5px solid var(--text-3);
  border-radius: 5px;
  transition: background var(--t-ui), border-color var(--t-ui);
}

.confirm-item .mark svg {
  width: 0.8rem;
  height: 0.8rem;
  stroke-width: 2.4;
  opacity: 0;
  transition: opacity var(--t-ui);
}

.confirm-item input:checked ~ .mark {
  background: var(--action);
  border-color: var(--action);
  color: var(--night);
}

.confirm-item input:checked ~ .mark svg {
  opacity: 1;
}

.confirm.invalid .confirm-list {
  border-color: rgba(255, 122, 138, 0.6);
}

/* Estados de pantalla: éxito, aviso, inicio de sesión */

.success,
.notice,
.login-gate {
  padding: 3rem 2rem;
  text-align: center;
  animation: step-in 240ms var(--ease-out);
}

.state-icon {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1.25rem;
  border-radius: var(--radius);
  font-size: 1.5rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
}

.state-icon.ok { color: var(--ok); }
.state-icon.warn { color: var(--warn); }

.success h2,
.notice h2,
.login-gate h2 {
  margin-bottom: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.success p,
.notice p,
.login-gate p {
  max-width: 30rem;
  margin: 0 auto 1.75rem;
  color: var(--text-2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.login-gate .link-btn {
  margin-top: 1.25rem;
}

.link-btn {
  padding: 0;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--text-2);
  background: none;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--text);
}

.account {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.account-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.account-info {
  flex: 1;
  min-width: 0;
  font-size: 0.9375rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-3);
}

.account-user {
  color: var(--text-3);
}

/* Avisos */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 100;
  max-width: calc(100% - 2rem);
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid rgba(255, 122, 138, 0.4);
  color: var(--text);
  font-size: 0.9375rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, 150%);
  opacity: 0;
  transition: transform 160ms ease-in, opacity 160ms ease-in;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
  transition: transform 220ms var(--ease-out), opacity 220ms var(--ease-out);
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-right: 0.5rem;
}

.toast-close {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin: -0.5rem 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-2);
  font-size: 1.125rem;
  cursor: pointer;
}

.toast-close:hover {
  color: var(--text);
  background: var(--surface);
}

.toast-close:focus-visible {
  outline: 2px solid var(--action);
}

.form-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 122, 138, 0.45);
  background: rgba(255, 122, 138, 0.08);
  color: var(--text);
  font-size: 0.9375rem;
}

.form-alert .icon {
  margin-top: 0.2rem;
  color: var(--danger);
}

/* Pie con el horizonte */

.footer {
  position: relative;
  overflow: hidden;
  padding-top: 1rem;
}

.footer-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 2rem;
}

.footer-copy {
  font-size: 0.8125rem;
  color: var(--text-3);
}

/* Sin overflow propio: el brillo sube libre y el pie (overflow: hidden) recorta solo los lados y el fondo */
.horizon {
  position: relative;
  height: 110px;
  pointer-events: none;
}

.horizon::before {
  content: "";
  position: absolute;
  left: -25%;
  right: -25%;
  top: 28px;
  height: 900px;
  border-radius: 50%;
  border-top: 1px solid rgba(185, 168, 255, 0.85);
  background: radial-gradient(60% 40% at 50% 0%, #241c63, #0b0b22 70%);
  box-shadow: 0 -8px 40px -6px rgba(185, 168, 255, 0.45), 0 -30px 80px -10px rgba(107, 60, 255, 0.25);
}

.credit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  font-size: 0.8125rem;
  color: var(--text-3);
  border-radius: 6px;
  transition: color var(--t-ui);
}

.credit img {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  object-fit: cover;
}

.credit strong {
  color: var(--text-2);
  font-weight: 600;
}

.credit:hover,
.credit:hover strong {
  color: var(--text);
}

.credit:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}

/* Más contraste y menos transparencia cuando el sistema lo pide */

@media (prefers-contrast: more) {
  :root {
    --text-3: var(--text-2);
    --border: rgba(170, 178, 207, 0.4);
    --border-strong: rgba(170, 178, 207, 0.8);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .header.scrolled {
    background: var(--night);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Movimiento reducido: solo fundidos */

@media (prefers-reduced-motion: reduce) {
  .enter { animation-name: fade; }
  .form-step,
  .success,
  .notice,
  .login-gate { animation-name: fade; }
  .btn:active:not([disabled]) { transform: none; }
  .toast,
  .toast.show { transform: translate(-50%, 0); }
  .toast:not(.show) { visibility: hidden; }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
