/* ═══════════════════════════════════════════════════════════════════
   BUFATTY · AUTH (login · register) · v11
   IG-level. 2 columnas. Brand consistente con la landing.
   ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   BODY
   ═══════════════════════════════════════════════════════════════════ */
.auth-body {
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

.auth-body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 55% 45% at 20% 0%,
      color-mix(in srgb, var(--accent) 8%, transparent) 0%,
      transparent 65%),
    radial-gradient(ellipse 45% 40% at 90% 100%,
      color-mix(in srgb, var(--secondary) 5%, transparent) 0%,
      transparent 70%);
}

/* ═══════════════════════════════════════════════════════════════════
   MAIN — 2 columnas
   ═══════════════════════════════════════════════════════════════════ */
.auth-main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-layout {
  width: 100%;
  max-width: 1000px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
}

.auth-layout--single {
  grid-template-columns: 1fr;
  max-width: 420px;
  gap: 0;
}

.auth-layout--single .auth-form-col {
  max-width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════
   COLUMNA IZQUIERDA — collage + claim
   ═══════════════════════════════════════════════════════════════════ */
.auth-hero {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

.auth-collage {
  position: relative;
  width: 100%;
  max-width: 380px;
  height: 360px;
}

.auth-collage-img {
  position: absolute;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color-soft);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  background-size: cover;
  background-position: center;
}

html[data-theme="light"] .auth-collage-img {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.auth-collage-img--1 {
  width: 200px;
  height: 270px;
  top: 45px;
  left: 50%;
  transform: translateX(-50%) rotate(-1deg);
  z-index: 3;
}

.auth-collage-img--2 {
  width: 150px;
  height: 200px;
  top: 20px;
  left: 10px;
  transform: rotate(-9deg);
  z-index: 2;
}

.auth-collage-img--3 {
  width: 150px;
  height: 200px;
  top: 30px;
  right: 10px;
  transform: rotate(9deg);
  z-index: 2;
}

.auth-collage-img--4 {
  width: 140px;
  height: 175px;
  bottom: 0;
  left: 30px;
  transform: rotate(-6deg);
  z-index: 1;
  opacity: 0.92;
}

.auth-collage-img--5 {
  width: 140px;
  height: 175px;
  bottom: 0;
  right: 30px;
  transform: rotate(6deg);
  z-index: 1;
  opacity: 0.92;
}

.auth-claim {
  font-family: var(--font-sans);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  text-align: center;
  color: var(--text-primary);
  margin: 0;
  max-width: 360px;
}

.auth-claim em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════════
   COLUMNA DERECHA — form
   ═══════════════════════════════════════════════════════════════════ */
.auth-form-col {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ─── Head ─── */
.auth-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  margin-bottom: 8px;
}

.auth-head .brand-mark {
  width: 56px;
  height: 56px;
  margin: 0 0 4px;
}

/* ─── Badge (igual que landing) ─── */
.auth-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent);
  padding: 5px 12px;
  border-radius: 100px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  margin-bottom: 4px;
}

/* ─── Título ─── */
.auth-title {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.8px;
  color: var(--text-primary);
  margin: 0;
}

.auth-subtitle {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
  max-width: 340px;
}

/* ═══════════════════════════════════════════════════════════════════
   BOTÓN GOOGLE OAUTH — pill
   ═══════════════════════════════════════════════════════════════════ */
.auth-oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  border: 1px solid var(--border-color);
  border-radius: 100px;
  background: color-mix(in srgb, var(--bg-input) 70%, transparent);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
  min-height: 48px;
  line-height: 1.2;
  box-sizing: border-box;
}

.auth-oauth-btn:hover {
  background: var(--bg-input-focus);
  border-color: color-mix(in srgb, var(--text-muted) 40%, transparent);
  text-decoration: none;
  color: var(--text-primary);
  transform: translateY(-1px);
}

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

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

.auth-oauth-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.auth-oauth-text {
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════
   FORM
   ═══════════════════════════════════════════════════════════════════ */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

/* ═══════════════════════════════════════════════════════════════════
   INPUT — más alto, radio más suave
   ═══════════════════════════════════════════════════════════════════ */
.auth-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  outline: none;
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus,
.auth-input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  caret-color: var(--text-primary);
  transition: background-color 9999s ease-in-out 0s;
  border-color: transparent;
}

.auth-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 14.5px;
}

.auth-input:hover {
  background: var(--bg-input-focus);
}

.auth-input:focus {
  background: var(--bg-input-focus);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.auth-input[aria-invalid="true"] {
  border-color: var(--danger);
}

.auth-input[aria-invalid="true"]:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 15%, transparent);
}

.auth-error {
  display: block;
  font-size: 12.5px;
  color: var(--danger);
  font-weight: 500;
  padding-left: 2px;
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════════
   TOGGLE PASSWORD
   ═══════════════════════════════════════════════════════════════════ */
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrap .auth-input {
  padding-right: 76px;
}

.auth-input-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.1px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.auth-input-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.auth-input-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════════
   SUBMIT — gradiente brand, pill
   ═══════════════════════════════════════════════════════════════════ */
.auth-submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 24px;
  margin-top: 8px;
  border: none;
  border-radius: 100px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.1px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.15s ease;
  white-space: nowrap;
  line-height: 1.2;
  min-height: 50px;
  box-shadow:
    0 8px 24px color-mix(in srgb, var(--accent) 35%, transparent),
    0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent);
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 14px 36px color-mix(in srgb, var(--accent) 45%, transparent),
    0 0 0 6px color-mix(in srgb, var(--accent) 12%, transparent);
}

.auth-submit:active:not(:disabled) {
  transform: translateY(0);
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.75;
}

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

.auth-submit.is-loading {
  color: transparent;
  pointer-events: none;
}

.auth-submit.is-loading .auth-submit-label {
  opacity: 0;
}

.auth-submit.is-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .auth-submit.is-loading::after {
    animation-duration: 1.5s;
  }
}

/* Variante secundaria (verify_email_sent → "Reenviar correo") */
.auth-submit--secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  margin-top: 0;
  box-shadow: none;
}

.auth-submit--secondary:hover:not(:disabled) {
  background: var(--bg-input-focus);
  border-color: color-mix(in srgb, var(--text-muted) 35%, transparent);
  transform: none;
  box-shadow: none;
}

/* ═══════════════════════════════════════════════════════════════════
   SEPARADOR "o"
   ═══════════════════════════════════════════════════════════════════ */
.auth-sep {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: lowercase;
}

.auth-sep::before,
.auth-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* ═══════════════════════════════════════════════════════════════════
   BOX (register / login prompt) — pill radius, borde sutil
   ═══════════════════════════════════════════════════════════════════ */
.auth-box {
  padding: 16px 20px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.auth-box:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border-color));
  background: color-mix(in srgb, var(--accent) 3%, transparent);
}

.auth-box a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.15s ease;
}

.auth-box a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Variante informativa (verify_email_sent) */
.auth-box--info {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
  text-align: left;
}

.auth-box--info .auth-box-text {
  margin: 0 0 8px;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.6;
}

.auth-box--info .auth-box-text strong {
  color: var(--text-primary);
  font-weight: 700;
}

.auth-box--info .auth-box-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════
   FORGOT
   ═══════════════════════════════════════════════════════════════════ */
.auth-forgot {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  text-align: center;
  font-weight: 500;
  padding: 4px 0;
  transition: color 0.15s ease;
}

.auth-forgot:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════
   TÉRMINOS (register)
   ═══════════════════════════════════════════════════════════════════ */
.auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  position: relative;
  padding: 4px 0;
}

.auth-terms input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.auth-terms::before {
  content: '';
  width: 14px;
  height: 14px;
  margin-top: 2px;
  border: 1.5px solid color-mix(in srgb, var(--text-muted) 55%, transparent);
  border-radius: 4px;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
  background: transparent;
  box-sizing: border-box;
}

.auth-terms:has(input:checked)::before {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-size: 9px 9px;
  background-position: center;
  background-repeat: no-repeat;
}

.auth-terms:hover::before {
  border-color: var(--text-secondary);
}

.auth-terms span {
  flex: 1;
  min-width: 0;
}

.auth-terms a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
}

.auth-terms a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════ */
.auth-foot {
  position: relative;
  z-index: 1;
  padding: 24px 20px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.auth-foot-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.auth-foot-links a {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.auth-foot-links a:hover {
  color: var(--text-secondary);
}

.auth-foot-copy {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.1px;
}

/* ═══════════════════════════════════════════════════════════════════
   HONEYPOT
   ═══════════════════════════════════════════════════════════════════ */
.auth-honeypot {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */

@media (min-width: 876px) {
  .auth-hero {
    display: flex;
  }
}

@media (max-width: 875px) {
  .auth-main {
    padding: 32px 20px 20px;
  }
  .auth-layout {
    grid-template-columns: 1fr;
    max-width: 400px;
    gap: 0;
  }
  .auth-form-col {
    max-width: 100%;
  }
  .auth-head .brand-mark {
    width: 52px;
    height: 52px;
  }
  .auth-title {
    font-size: 26px;
  }
  .auth-input {
    font-size: 16px;   /* evita zoom en iOS */
  }
  .auth-submit {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .auth-main {
    padding: 24px 16px 16px;
  }
  .auth-title {
    font-size: 24px;
  }
  .auth-foot {
    padding: 20px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-input,
  .auth-submit,
  .auth-forgot,
  .auth-terms::before,
  .auth-input-toggle,
  .auth-foot-links a,
  .auth-box a,
  .auth-oauth-btn,
  .auth-box {
    transition: none;
  }
  .auth-submit:hover:not(:disabled) {
    transform: none;
  }
}