/* ─── ReservaSimple · Auth (login / registro / recuperar) ─── */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --secondary: #7c3aed;
  --gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --bg: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-muted: #f1f5f9;
  --border: rgba(0, 0, 0, 0.09);
  --border-strong: #e2e8f0;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08), 0 8px 16px rgba(0, 0, 0, 0.04);
  --radius: 16px;
  --radius-sm: 12px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout ─── */
.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* Panel de marca (izquierda) */
.auth-brand {
  position: relative;
  overflow: hidden;
  background: var(--gradient);
  color: #fff;
  padding: 3rem clamp(2rem, 5vw, 4.5rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
}

.auth-orb { position: absolute; border-radius: 50%; pointer-events: none; }
.auth-orb-1 { width: 520px; height: 520px; top: -200px; right: -180px; background: radial-gradient(circle, rgba(255, 255, 255, 0.10), transparent 70%); }
.auth-orb-2 { width: 380px; height: 380px; bottom: -160px; left: -120px; background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 70%); }

.auth-brand > :not(.auth-orb) { position: relative; z-index: 1; }

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
}
.brand-logo:hover { text-decoration: none; }

.brand-body { max-width: 440px; }

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}
.brand-badge span { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse-dot 2s ease infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.7); } }

.brand-title {
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.brand-sub {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 2rem;
}

.brand-list { list-style: none; display: flex; flex-direction: column; gap: 0.9rem; }
.brand-list li { display: flex; align-items: flex-start; gap: 0.75rem; font-size: 0.95rem; color: rgba(255, 255, 255, 0.9); }
.brand-list i {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  margin-top: -2px;
}

.brand-foot { font-size: 0.8rem; color: rgba(255, 255, 255, 0.55); }

/* Columna del formulario (derecha) */
.auth-main {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  background: var(--bg);
}

.auth-glow {
  position: absolute;
  top: -25%;
  left: 50%;
  transform: translateX(-50%);
  width: 820px;
  height: 640px;
  background: radial-gradient(ellipse at center, rgba(79, 70, 229, 0.07) 0%, rgba(124, 58, 237, 0.03) 50%, transparent 70%);
  pointer-events: none;
}

.auth-card { position: relative; z-index: 1; width: 100%; max-width: 420px; }

.mobile-logo {
  display: none;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--primary);
  margin-bottom: 2rem;
}
.mobile-logo:hover { text-decoration: none; }

.auth-title {
  font-size: clamp(1.6rem, 3vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.auth-sub { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 2rem; }

/* ─── Alertas ─── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}
.alert i { margin-top: 0.2rem; flex: none; }
.alert-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }

/* ─── Campos ─── */
.field { margin-bottom: 1.15rem; }

.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.field-label { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.field-hint { font-weight: 500; color: var(--text-muted); }

.field-link { font-size: 0.82rem; font-weight: 600; white-space: nowrap; }

.control { position: relative; }

.control-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
  transition: color 0.2s ease;
}

.input {
  display: block;
  width: 100%;
  height: 3.1rem;
  padding: 0 1rem 0 2.75rem;
  font-family: inherit;
  font-size: 1rem; /* 16px: evita el zoom automático en iOS */
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder { color: var(--text-muted); opacity: 1; }
.input:hover { border-color: #cbd5e1; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12); }
.control:focus-within .control-icon { color: var(--primary); }

.input.has-toggle { padding-right: 3rem; }

select.input {
  cursor: pointer;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  text-overflow: ellipsis;
}

.toggle-pass {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.toggle-pass:hover { color: var(--text); background: var(--bg-muted); }
.toggle-pass:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

.input.is-invalid,
.input.is-invalid:hover { border-color: var(--danger); }
.input.is-invalid:focus { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1); }
.control:has(.is-invalid) .control-icon { color: var(--danger); }

.invalid-feedback {
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.45;
  margin-top: 0.4rem;
}
.invalid-feedback:empty { display: none; }

.field-help {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  overflow-wrap: anywhere;
}
.field-help strong { color: var(--text-secondary); font-weight: 600; }
.field:has(.invalid-feedback:not(:empty)) .field-help { display: none; }

/* ─── reCAPTCHA ─── */
.recaptcha-wrap { display: flex; flex-direction: column; align-items: center; margin: 1.5rem 0 0.5rem; }
.recaptcha-box { min-height: 78px; }
.recaptcha-wrap .invalid-feedback { text-align: center; }

/* ─── Botón ─── */
.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  height: 3.2rem;
  margin-top: 1rem;
  padding: 0 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--gradient);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
  transition: var(--transition);
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(79, 70, 229, 0.4); }
.btn-submit:active { transform: translateY(0); }
.btn-submit:focus-visible { outline: 3px solid rgba(79, 70, 229, 0.35); outline-offset: 2px; }
.btn-submit:disabled { opacity: 0.7; cursor: wait; transform: none; }

.legal {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-top: 1.25rem;
}
.legal a { color: var(--text-secondary); text-decoration: underline; text-underline-offset: 2px; }
.legal a:hover { color: var(--primary); }

.switch-link {
  text-align: center;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--text-secondary);
}
.switch-link a { font-weight: 700; }

.back-link {
  width: max-content;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}
.back-link:hover { color: var(--primary); text-decoration: none; }

/* ─── Pantalla de resultado (reset-message) ─── */
.status { text-align: center; }

.status-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.5rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
}
.status-icon.is-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.status-icon.is-error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }

.status .auth-sub { margin-bottom: 1.75rem; }

.status-actions { display: flex; flex-direction: column; gap: 0.75rem; }
.status-actions .btn-submit { margin-top: 0; text-decoration: none; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  height: 3.2rem;
  padding: 0 1.5rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  transition: var(--transition);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .auth { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
  .brand-list li:nth-child(n+4) { display: none; }
}

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-main { justify-content: flex-start; padding: 2.5rem 1.25rem 3rem; }
  .mobile-logo { display: flex; width: max-content; }
  .auth-card { margin-top: clamp(0rem, 6vh, 3rem); }
}

@media (max-width: 380px) {
  .auth-main { padding-left: 1rem; padding-right: 1rem; }
  /* El widget de reCAPTCHA mide 304px fijo: se escala para que entre en pantallas angostas */
  .recaptcha-box { transform: scale(0.92); transform-origin: center top; }
}

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