/* ═══════════════════════════════════════════════════════════════
   TRIAKA WEB — Shared auth-page styles
   Reusa los design tokens del landing/index.html.
   Cargado por login.html, register.html, app.html.
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Brand cyan mobile-matched: #00b4ff (mismo del LoginScreen / RadarPulse / glass card border) */
  --accent: #00b4ff;
  --accent-2: #00ff88;
  --accent-glow: rgba(0, 180, 255, 0.12);
  --bg-void: #000;
  --bg-deep: #020405;
  --bg-base: #040608;
  --bg-surface: #080b0f;
  --bg-elevated: #0c1015;
  --bg-overlay: #10151a;
  --bg-hover: #151b22;
  --text-primary: #fff;
  --text-secondary: rgba(255,255,255,.7);
  --text-tertiary: rgba(255,255,255,.5);
  --text-muted: rgba(255,255,255,.35);
  --border-subtle: rgba(255,255,255,.04);
  --border-default: rgba(255,255,255,.08);
  --border-emphasis: rgba(255,255,255,.12);
  --border-accent: rgba(0,212,255,.2);
  --danger: #ef4444;
  --success: #22c55e;
  --shadow-xl: 0 24px 80px rgba(0,0,0,.6);
  --shadow-glow: 0 0 60px rgba(0,212,255,.15);
  --font-display: 'Space Grotesk', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
}

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

/* `html` carga el color base para que si JS no monta a tiempo no haya FOUC.
   `body` queda transparente para que el `.wayra-bg` (fixed, z-index 0) sea
   visible debajo del contenido. */
html {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
body {
  background: transparent;
  min-height: 100vh;
  color: var(--text-primary);
  position: relative;
}

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

/* ─── Layout ──────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.auth-header {
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.auth-card-wrap {
  position: relative;
  width: 100%;
  max-width: 440px;
}

.auth-card-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(0,212,255,.35), transparent 70%);
  filter: blur(60px);
  opacity: .4;
  z-index: -1;
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 24px;
  padding: 36px 32px;
  box-shadow: var(--shadow-xl);
}

/* ─── Brand / logo (esquina, ancla nav) ─ */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
  text-decoration: none;
}
.brand-icon {
  width: 36px; height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, #00d4ff 0%, #00ff88 100%);
  color: #000;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 0 24px rgba(0,212,255,.4);
}
.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .5px;
}
.brand-text .accent { color: var(--accent); }

/* ─── Hero brand (arriba de la card, presencia FUERTE) ───
   Espejado del LoginScreen mobile: puck pulsante grande +
   "TriakaMap" mixed case + tagline "Explore the wild". */
.auth-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  text-align: center;
}

/* Hero puck — port 1:1 del RadarPulse mobile (LoginScreen.js:25-73):
   container 80x80, 3 rings borderColor #00b4ff borderWidth 1.5px,
   scale 0.4 → 1.2, opacity 0 → 1 → 0 con stops [0, 0.2, 1],
   delays 0/800/1600ms sobre duración 2400ms.
   Dot 14x14 solid #00b4ff (sin borde blanco), shadow #00b4ff. */
.auth-hero .hero-puck {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.auth-hero .hero-puck .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #00b4ff;
  box-shadow: 0 0 12px rgba(0,180,255,0.8);
  z-index: 3;
}
.auth-hero .hero-puck .ring {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  border: 1.5px solid #00b4ff;
  transform: scale(0.4);
  opacity: 0;
  animation: hero-pulse-ring 2.4s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  pointer-events: none;
}
.auth-hero .hero-puck .ring.r2 { animation-delay: 0.8s; }
.auth-hero .hero-puck .ring.r3 { animation-delay: 1.6s; }

@keyframes hero-pulse-ring {
  0%   { transform: scale(0.4); opacity: 0; }
  20%  { transform: scale(0.56); opacity: 1; }
  100% { transform: scale(1.2); opacity: 0; }
}

/* Espejado 1:1 del LoginScreen mobile: system font + 800 + spacing 1px.
   NO Space Grotesk acá — el mobile usa font system nativa, replicamos. */
.auth-hero .hero-name {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-weight: 800;
  font-size: 36px;
  letter-spacing: 1px;
  line-height: 1;
  color: #fff;
}
.auth-hero .hero-name .accent {
  color: #00b4ff;
}
.auth-hero .hero-tagline {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255,255,255,0.55);
  letter-spacing: 2px;
  margin-top: 4px;
  text-transform: none;
}

@media (max-width: 640px) {
  .auth-hero .hero-puck { width: 80px; height: 80px; }
  .auth-hero .hero-name { font-size: 30px; }
}

/* ─── Typography ──────────────────────── */
h1.auth-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.02em;
}
.auth-subtitle {
  color: var(--text-tertiary);
  font-size: 14px;
  margin-top: 8px;
  margin-bottom: 28px;
}

/* ─── Form ────────────────────────────── */
.auth-form { display: flex; flex-direction: column; gap: 18px; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.field input {
  height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: all .2s;
}
.field input::placeholder { color: var(--text-muted); }
.field input:focus {
  border-color: #00b4ff;
  background: var(--bg-overlay);
  box-shadow: 0 0 0 3px rgba(0,180,255,0.15);
}
.field input.error { border-color: var(--danger); }
.field-hint {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  margin-top: 6px;
  letter-spacing: 0.1px;
  line-height: 1.4;
}
.field .err-msg {
  color: var(--danger);
  font-size: 12px;
  font-weight: 500;
}

/* ─── Button ──────────────────────────── */
.btn {
  height: 48px;
  padding: 0 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .02em;
  transition: all .2s;
}
/* Botón primario = gradient cyan→azul-medio espejado del LoginScreen mobile
   (LinearGradient colors={['#00c4ff', '#0090d0']}). */
.btn.primary {
  background: linear-gradient(90deg, #00c4ff 0%, #0090d0 100%);
  color: #fff;
  box-shadow: 0 0 16px rgba(0,180,255,0.5);
  font-weight: 800;
  letter-spacing: 0.5px;
}
.btn.primary:hover:not(:disabled) { filter: brightness(1.1); }
.btn.primary:disabled { opacity: .5; cursor: not-allowed; }

.btn.ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}
.btn.ghost:hover { color: var(--accent); border-color: var(--accent); }

/* ─── Alert ───────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  border: 1px solid;
}
.alert.error {
  background: rgba(239,68,68,.1);
  border-color: rgba(239,68,68,.3);
  color: var(--danger);
}
.alert.success {
  background: rgba(34,197,94,.1);
  border-color: rgba(34,197,94,.3);
  color: var(--success);
}

/* ─── Footer link ─────────────────────── */
.auth-footer {
  text-align: center;
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-tertiary);
}
.auth-footer a { font-weight: 600; }

/* ─── Dashboard ───────────────────────── */
.dash-header {
  padding: 20px 32px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dash-user {
  color: var(--text-tertiary);
  font-size: 14px;
}
.dash-user b { color: var(--text-primary); font-weight: 600; }

.dash-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 64px 32px;
}
.dash-hero h1 {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.dash-hero p {
  color: var(--text-secondary);
  font-size: 18px;
  max-width: 600px;
}

.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 56px;
}
.dash-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 20px;
  padding: 24px;
  transition: all .2s;
}
.dash-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}
.dash-card .phase {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .15em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.dash-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.dash-card p {
  color: var(--text-tertiary);
  font-size: 14px;
  line-height: 1.5;
}

/* ─── Focus ring ──────────────────────── */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   WILD BACKGROUND — Foto bosque misty (ForestBg del mobile)
   + overlay brand cyan + pucks pulsantes.
   Recipe espejado de wayra-mobile/src/components/ForestBg.js para
   coherencia visual mobile ↔ web.
   ═══════════════════════════════════════════════════════════════ */
.wayra-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background-color: #050a07;
}

/* Todo el contenido auth/dash queda encima del wild bg (z-index: 1). */
.auth-page,
.dash-header,
.dash-main {
  position: relative;
  z-index: 1;
}

/* 1) Foto base — misty pine forest dark (Unsplash by Sergei Akulich).
   Mismo URL que ForestBg.js mobile. */
.wayra-bg .forest {
  position: absolute;
  inset: 0;
  background-image: url('https://images.unsplash.com/photo-1448375240586-882707db888b?auto=format&fit=crop&w=1600&q=85');
  background-size: cover;
  background-position: center;
  animation: forest-fade-in 0.6s ease-out;
}
@keyframes forest-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 2) Overlay dark para legibilidad (62% como el mobile) */
.wayra-bg .dark-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 14, 11, 0.62);
}

/* 3) Gradient brand: cyan tinge top → vignette bottom (matches mobile) */
.wayra-bg .brand-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 180, 255, 0.10) 0%,
    rgba(13, 21, 18, 0.30) 55%,
    rgba(5, 10, 7, 0.85) 100%
  );
}

/* Vignette extra para focus al centro */
.wayra-bg .vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0,0,0,0.45) 100%);
}

/* ─── Pulsing puck ─── Mismo lenguaje visual que el LocationPuck mobile
   (dot cyan + halo expandiendo). Position via inline style por page. */
.wayra-puck {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #00d4ff;
  border: 2px solid rgba(255,255,255,0.95);
  box-shadow: 0 0 14px rgba(0,212,255,0.9), 0 2px 8px rgba(0,0,0,0.4);
  z-index: 1;
}
.wayra-puck::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgba(0,212,255,0.45);
  animation: wayra-pulse 2.4s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  animation-delay: var(--puck-delay, 0s);
  z-index: -1;
}
.wayra-puck::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgba(0,212,255,0.25);
  animation: wayra-pulse 2.4s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  animation-delay: calc(var(--puck-delay, 0s) + 1.2s);
  z-index: -1;
}

@keyframes wayra-pulse {
  0%   { transform: scale(0.9); opacity: 0.9; }
  80%  { opacity: 0; }
  100% { transform: scale(5.5); opacity: 0; }
}

/* Variante secundaria — verde Triaka para diferenciar pucks en el fondo */
.wayra-puck.alt {
  background: #00ff88;
  box-shadow: 0 0 14px rgba(0,255,136,0.85), 0 2px 8px rgba(0,0,0,0.4);
}
.wayra-puck.alt::before,
.wayra-puck.alt::after {
  background: rgba(0,255,136,0.35);
}

/* ─── Title puck ─── Puck inline dentro de la card, arriba del título.
   Más grande que los del bg, presence más fuerte. */
.title-puck {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #00d4ff;
  border: 2.5px solid rgba(255,255,255,0.95);
  box-shadow: 0 0 20px rgba(0,212,255,1), 0 2px 10px rgba(0,0,0,0.5);
  margin: 0 0 18px 0;
}
.title-puck::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgba(0,212,255,0.5);
  animation: wayra-pulse 2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  z-index: -1;
}
.title-puck::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgba(0,212,255,0.3);
  animation: wayra-pulse 2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  animation-delay: 1s;
  z-index: -1;
}

/* En pantallas chicas reducimos densidad para no saturar */
@media (max-width: 640px) {
  .wayra-bg .blob.b3 { display: none; }
  .wayra-puck { transform: scale(0.85); }
}
