/* ============================================================================
 * Archivo: public/assets/css/auth.css
 * Propósito: Estilos fieles a los mockups de Login y Registro · Capos Digitales
 * Reglas UX: 100dvh, 16px anti-zoom iOS, -webkit-autofill oscuro, 6 cortes
 * ============================================================================ */

:root {
  --bg-deep: #090b10;
  --bg-card: #12151e;
  --bg-input: #171b26;
  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-lime: rgba(182, 255, 46, 0.65);
  --border-purple: rgba(168, 85, 247, 0.78);
  --lime: #b6ff2e;
  --lime-hover: #c9ff5c;
  --purple: #a855f7;
  --text-main: #f8fafc;
  --text-muted: #9ca3af;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* --- AUTOCOMPLETADO CHROME OSCURO --- */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f8fafc !important;
  -webkit-box-shadow: 0 0 0 1000px #171b26 inset !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* --- TOASTS --- */
.toast-container {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 32px));
}
.toast-item {
  background: #141824;
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--lime);
  color: #fff;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 0.92rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
  animation: toastIn 0.25s ease;
}
.toast-item.is-error { border-left-color: var(--danger); }
.toast-item.is-success { border-left-color: var(--success); }
.toast-item.is-info { border-left-color: var(--info); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- LAYOUT SPLIT LOGIN --- */
.auth-login-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  gap: 22px;
  padding: 20px;
  background:
    radial-gradient(circle at 12% 14%, rgba(168, 85, 247, 0.22), transparent 40%),
    radial-gradient(circle at 52% 18%, rgba(182, 255, 46, 0.14), transparent 42%),
    var(--bg-deep);
}

.login-showcase {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.login-hero-stage {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  min-height: 360px;
  flex: 1;
  background-color: #07090e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 30px 34px;
}

/* Imagen oficial fondo-login.webp alineada a la derecha (LEEME.md) */
.login-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  z-index: 0;
  transition: filter 0.35s ease, transform 0.5s ease;
}

.login-hero-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7, 9, 14, 0.94) 0%, rgba(7, 9, 14, 0.72) 44%, rgba(7, 9, 14, 0.14) 76%, rgba(7, 9, 14, 0.25) 100%);
  z-index: 1;
}

.login-hero-stage.is-privacy .login-hero-bg {
  filter: brightness(0.68) saturate(0.8);
}

.login-hero-content {
  position: relative;
  z-index: 2;
  max-width: 540px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}
.brand-lockup img {
  width: 54px;
  height: auto;
  display: block;
}
.brand-lockup img.brand-capo-emblem {
  width: 112px;
  height: 112px;
  border-radius: 18px;
  object-fit: cover;
  border: 0;
  box-shadow: 0 0 26px rgba(182, 255, 46, 0.35);
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 54%, transparent 96%);
  mask-image: radial-gradient(circle at 50% 45%, #000 54%, transparent 96%);
}
.brand-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 0.9;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.brand-wordmark .w-top { font-size: 2.35rem; color: #fff; font-style: italic; text-shadow: 0 4px 18px rgba(0, 0, 0, 0.7); }
.brand-wordmark .w-bot { font-size: 2.05rem; color: var(--lime); font-style: italic; text-shadow: 0 4px 18px rgba(182, 255, 46, 0.28); }
.brand-swoosh { width: 100%; max-width: 210px; height: 12px; margin-top: 4px; display: block; }

.hero-headline {
  margin: 0;
  font-weight: 900;
  font-style: italic;
  line-height: 0.88;
}
.hero-headline .hl-sub {
  display: block;
  font-size: clamp(2.5rem, 4.1vw, 3.55rem);
  color: #fff;
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.75);
}
.hero-headline .hl-main {
  display: block;
  font-size: clamp(4.8rem, 8vw, 7rem);
  background: linear-gradient(180deg, #e7ff87 0%, #b6ff2e 55%, #7bd400 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 28px rgba(182, 255, 46, 0.48));
}

.hero-tagline {
  margin: 14px 0 0;
  padding-left: 14px;
  border-left: 4px solid var(--lime);
  font-size: clamp(1rem, 1.35vw, 1.18rem);
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.3;
  max-width: 340px;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(182, 255, 46, 0.12);
  border: 1px solid rgba(182, 255, 46, 0.45);
  color: var(--lime);
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.login-hero-stage.is-privacy .privacy-pill {
  opacity: 1;
  transform: translateY(0);
}

/* --- EXPLORA LAS COMUNIDADES --- */
.explore-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  font-style: italic;
  margin: 2px 0 10px;
}
.explore-header span { color: var(--lime); }

.communities-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.community-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #10131c;
  border: 1.5px solid rgba(182, 255, 46, 0.68);
  box-shadow: 0 0 22px rgba(182, 255, 46, 0.16);
  display: flex;
  flex-direction: column;
  min-height: 205px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.community-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(182, 255, 46, 0.22);
}

.community-card-media {
  position: relative;
  height: 118px;
  overflow: hidden;
  background: #0b0d14;
}
.community-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.badge-18 {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(10, 12, 18, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 7px;
}

.community-card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  gap: 6px;
}
.community-card-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  font-style: italic;
  color: #fff;
}
.community-card-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}
.community-card-sub {
  margin: 0;
  font-size: 0.75rem;
  color: #cbd5e1;
  line-height: 1.25;
}
.community-arrow {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--lime);
  color: #090b10;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0.85rem;
}

.ecom-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(18, 16, 36, 0.95), rgba(38, 16, 62, 0.72));
  border: 1.5px solid var(--border-purple);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.22);
}
.ecom-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ecom-banner-brand {
  font-weight: 900;
  font-style: italic;
  font-size: 1.15rem;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ecom-banner-desc {
  color: #cbd5e1;
  font-size: 0.86rem;
}
.ecom-banner-link {
  color: var(--lime);
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  white-space: nowrap;
}

/* --- TARJETA DE ACCESO DERECHA --- */
.auth-panel-card {
  background: linear-gradient(180deg, rgba(22, 26, 37, 0.96) 0%, rgba(12, 15, 22, 0.98) 100%);
  border: 1.5px solid rgba(182, 255, 46, 0.42);
  border-radius: 22px;
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 32px rgba(182, 255, 46, 0.08);
}

.auth-card-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.auth-card-logo img { width: 78px; height: auto; margin-bottom: 6px; }
.auth-card-logo .w-top { font-size: 1.7rem; }
.auth-card-logo .w-bot { font-size: 1.5rem; }

.auth-title {
  margin: 0 0 4px;
  font-size: 1.65rem;
  font-weight: 800;
  font-style: italic;
  line-height: 1.1;
}
.auth-subtitle {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* --- FORMULARIOS --- */
.form-group { margin-bottom: 15px; }
.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #e2e8f0;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon-left {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  display: inline-flex;
  pointer-events: none;
}

.form-control {
  width: 100%;
  min-height: 48px;
  padding: 12px 44px 12px 15px;
  font-size: 16px; /* Anti-zoom obligatorio en iOS */
  color: #fff;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-control.has-left-icon { padding-left: 42px; }
.form-control:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(182, 255, 46, 0.18);
}

.toggle-pass-btn {
  position: absolute;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 8px;
}
.toggle-pass-btn:hover { color: #fff; }

.caps-warning {
  display: none;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--warning);
  font-weight: 600;
}
.caps-warning.is-visible { display: block; }

.forgot-row {
  text-align: center;
  margin: 4px 0 16px;
}
.forgot-link {
  background: none;
  border: 0;
  color: var(--lime);
  font-size: 0.86rem;
  font-style: italic;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px;
}

.btn-lime {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #d7ff4a 0%, #a5ef1c 100%);
  color: #090b10;
  font-size: 1.05rem;
  font-weight: 800;
  font-style: italic;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(182, 255, 46, 0.28);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn-lime:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-lime:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-neon-outline {
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  border-radius: 12px;
  background: rgba(168, 85, 247, 0.08);
  border: 1.5px solid var(--border-purple);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  font-style: italic;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.2);
  transition: background 0.15s ease;
}
.btn-neon-outline:hover { background: rgba(168, 85, 247, 0.18); }

/* --- LAYOUT SPLIT REGISTRO (PROPORCIÓN EXACTA 1402:1122 DEL MONITOR) --- */
.auth-reg-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #0b0d12;
  padding: 20px 28px;
}

.reg-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.reg-topbar-link {
  color: #e2e8f0;
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.reg-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 440px);
  gap: 28px;
  align-items: center;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}

.reg-headline {
  margin: 0 0 18px;
  font-size: clamp(2rem, 3.6vw, 3.2rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.02em;
}
.reg-headline span { color: var(--lime); display: block; }

/* Contenedor 1402:1122 (LEEME.md) para escalar fondo y monitor juntos */
.studio-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1402 / 1122;
  border-radius: 18px;
  overflow: hidden;
  background: #090b10;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}
.studio-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Coordenadas exactas del monitor: 41.4%/36.2% a 97.1%/74.4% */
.studio-monitor-viewport {
  position: absolute;
  left: 41.4%;
  top: 35.4%;
  width: 55.7%;
  height: 39.0%;
  overflow: hidden;
  border-radius: 6px;
  background: #090b10;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.studio-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  opacity: 0;
  transition: opacity 0.85s ease;
}
.studio-scene.is-active { opacity: 1; }

.studio-controls {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  z-index: 4;
}
.studio-badge {
  background: rgba(9, 11, 16, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f8fafc;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.studio-pause-btn {
  background: rgba(9, 11, 16, 0.86);
  border: 1px solid rgba(182, 255, 46, 0.55);
  color: var(--lime);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.phone-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 10px;
}
.phone-prefix {
  padding: 12px 10px;
  font-size: 16px;
  color: #fff;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  min-height: 48px;
}

.privacy-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
}
.privacy-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--lime);
  flex: none;
}

.otp-step-box { display: none; }
.otp-step-box.is-visible { display: block; }
.otp-code-input {
  text-align: center;
  font-size: 1.65rem !important;
  font-weight: 800;
  letter-spacing: 0.4em;
  padding-right: 15px !important;
}

/* --- MODAL RECUPERAR CONTRASEÑA --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 11, 0.8);
  backdrop-filter: blur(6px);
  display: none;
  place-items: center;
  padding: 16px;
  z-index: 9000;
}
.modal-backdrop.is-open { display: grid; }
.modal-box {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid rgba(182, 255, 46, 0.4);
  border-radius: 18px;
  padding: 24px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.modal-close {
  background: none;
  border: 0;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

/* --- BOTÓN FLOTANTE WHATSAPP ADMINISTRADOR --- */
.wa-float-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 8000;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #25d366;
  color: #062814;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 12px 16px;
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.38);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.wa-float-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(37, 211, 102, 0.5);
}
.wa-float-btn svg { width: 22px; height: 22px; flex: none; }

/* --- RESPONSIVE (TABLET Y MÓVIL 360px - 1080px) --- */
@media (max-width: 1120px) {
  .auth-login-shell {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .auth-panel-card { order: -1; max-width: 480px; width: 100%; margin: 0 auto; }
  .communities-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reg-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .auth-login-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 12px 12px 76px;
  }
  .login-showcase { display: contents; }
  .login-hero-stage {
    order: 1;
    min-height: 220px;
    padding: 18px 18px 24px;
    border-radius: 18px;
  }
  .login-hero-stage::after {
    background: linear-gradient(90deg, rgba(7, 9, 14, 0.92) 0%, rgba(7, 9, 14, 0.65) 50%, rgba(7, 9, 14, 0.18) 100%);
  }
  .brand-lockup { gap: 10px; margin-bottom: 10px; }
  .brand-lockup img.brand-capo-emblem { width: 52px; height: 52px; }
  .brand-wordmark .w-top { font-size: 1.25rem; }
  .brand-wordmark .w-bot { font-size: 1.1rem; }
  .brand-swoosh { max-width: 115px; height: 8px; }
  .hero-headline .hl-sub { font-size: 1.65rem; }
  .hero-headline .hl-main { font-size: 3.15rem; }
  .hero-tagline { font-size: 0.86rem; margin-top: 10px; max-width: 220px; padding-left: 10px; }

  .auth-panel-card {
    order: 2;
    max-width: 100%;
    padding: 22px 18px;
    border-radius: 20px;
  }
  .auth-card-logo { padding-bottom: 12px; margin-bottom: 14px; }
  .auth-card-logo img { width: 54px; }
  .auth-card-logo .w-top { font-size: 1.35rem; }
  .auth-card-logo .w-bot { font-size: 1.2rem; }
  .auth-title { font-size: 1.45rem; }

  .login-explore-wrap { order: 3; }
  .explore-header { font-size: 1.08rem; margin-bottom: 10px; }
  .communities-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .community-card { min-height: 175px; border-radius: 14px; }
  .community-card-media { height: 92px; }
  .community-card-body { padding: 8px 10px 10px; }
  .community-card-title { font-size: 0.84rem; }
  .community-card-sub { font-size: 0.7rem; }
  .community-arrow { width: 22px; height: 22px; }

  .ecom-banner {
    order: 4;
    flex-direction: column;
    align-items: flex-start;
    padding: 14px;
    gap: 8px;
  }

  .wa-float-btn {
    width: 52px;
    height: 52px;
    padding: 0;
    justify-content: center;
    right: 14px;
    bottom: 14px;
  }
  .wa-float-btn span { display: none; }

  .reg-shell { padding: 12px 12px 76px; }
  .reg-studio-card { min-height: 170px; padding: 16px; }
  .reg-form-card { padding: 20px 16px; }
  .phone-row { grid-template-columns: 92px minmax(0, 1fr); gap: 8px; }
}

@media (max-width: 640px) {
  .auth-reg-shell { padding: 14px; }
  .login-hero-stage { padding: 22px 18px; min-height: 290px; }
  .communities-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ecom-banner { flex-direction: column; align-items: flex-start; }
  .wa-float-btn .wa-float-label { display: none; }
  .wa-float-btn { padding: 14px; border-radius: 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .studio-scene, .login-hero-bg, .toast-item { transition: none; animation: none; }
}
