/* ------------------------------------------------------------------ *
 * wabee-auth — sistema visual compartido (login / 403 / 404)
 * Estética heredada del login del monolito: marca verde Wabee + Poppins,
 * split de dos columnas (panel de marca + formulario). Signature propia:
 * lectura tipo osciloscopio (el producto monitorea formas de onda
 * eléctricas en tiempo real).
 * ------------------------------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
  --wb-green:        #0b9e5f;   /* verde de marca (acciones, foco)        */
  --wb-green-deep:   #077a48;   /* verde profundo (gradiente, hover)      */
  --wb-green-bright: #38e08a;   /* verde luminoso (onda / glow)           */
  --wb-ink:          #18212b;   /* tinta titulares                        */
  --wb-ink-soft:     #5b6770;   /* texto secundario                       */
  --wb-line:         #e1e6ea;   /* bordes y divisores                     */
  --wb-surface:      #ffffff;   /* superficie de tarjeta/formulario       */
  --wb-bg:           #eef2f5;   /* fondo frío (lado formulario / mobile)  */
  --wb-danger:       #c0392b;   /* error                                  */
  --wb-radius:       14px;
  --wb-radius-sm:    10px;
  --wb-shadow:       0 18px 48px -24px rgba(13, 60, 38, .45);
  --wb-ring:         0 0 0 3px rgba(11, 158, 95, .16);
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--wb-ink);
  background: var(--wb-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--wb-green); }

/* ============================== LAYOUT ============================= */
.layout {
  min-height: 100vh;
  display: flex;
}

/* ---------------------------- panel marca ------------------------- */
.brand {
  position: relative;
  flex: 1.15 1 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2.5rem, 4vw, 4rem);
  color: #fff;
  background:
    radial-gradient(120% 90% at 18% 8%, rgba(56, 224, 138, .35) 0%, transparent 55%),
    linear-gradient(155deg, #12b06d 0%, var(--wb-green) 46%, var(--wb-green-deep) 100%);
  isolation: isolate;
}

/* grilla de medición tenue (osciloscopio / blueprint) */
.brand::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 100%);
          mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 100%);
}

.brand__logo {
  width: 168px;
  height: auto;
  position: relative;
  z-index: 2;
}

.brand__content {
  position: relative;
  z-index: 2;
  max-width: 30rem;
  margin: auto 0;
  padding: 2.5rem 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .82);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--wb-green-bright);
}

.brand__headline {
  margin-top: 1.1rem;
  font-size: clamp(1.85rem, 2.7vw, 2.5rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.015em;
}

.brand__lead {
  margin-top: 1.1rem;
  font-size: 1.03rem;
  font-weight: 400;
  line-height: 1.6;
  color: rgba(255, 255, 255, .85);
  max-width: 27rem;
}

/* ilustración opcional (persona-con-laptop) — se integra si existe */
.brand__art {
  position: absolute;
  right: clamp(.5rem, 1.5vw, 2.5rem);
  bottom: 4.5rem;
  width: clamp(210px, 27vw, 330px);
  height: auto;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 24px 40px rgba(4, 40, 24, .35));
}
.brand__art[src=""], .brand__art:not([src]) { display: none; }

/* footer del panel: lectura "EN VIVO" + onda */
.brand__readout {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: .9rem;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  align-self: flex-start;
  padding: .32rem .7rem .32rem .6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
}
.live__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--wb-green-bright);
  box-shadow: 0 0 0 0 rgba(56, 224, 138, .6);
  animation: live-pulse 2.4s ease-out infinite;
}

.brand__wave {
  width: 100%;
  height: 64px;
  overflow: visible;
  color: var(--wb-green-bright);
}
.brand__wave-track {
  animation: wave-drift 14s linear infinite;
}
.brand__wave path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(56, 224, 138, .7));
}

@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(56, 224, 138, .55); }
  70%  { box-shadow: 0 0 0 9px rgba(56, 224, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 224, 138, 0); }
}
@keyframes wave-drift {
  from { transform: translateX(0); }
  to   { transform: translateX(-200px); }
}

/* --------------------------- panel auth --------------------------- */
.auth {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: var(--wb-surface);
}

.auth-box {
  width: 100%;
  max-width: 384px;
  animation: rise .45s cubic-bezier(.2, .7, .2, 1) both;
}

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

.auth-logo {
  display: none;            /* sólo en mobile, cuando se oculta el panel */
  width: 150px;
  height: auto;
  margin: 0 auto 1.75rem;
}

.auth-box h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.subtitle {
  margin-top: .35rem;
  margin-bottom: 1.5rem;
  color: var(--wb-ink-soft);
  font-size: .95rem;
}

form { display: flex; flex-direction: column; gap: .7rem; }

input {
  width: 100%;
  padding: .8rem .95rem;
  border: 1px solid var(--wb-line);
  border-radius: var(--wb-radius-sm);
  background: #fff;
  color: var(--wb-ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder { color: #9aa4ad; }
input:focus {
  outline: none;
  border-color: var(--wb-green);
  box-shadow: var(--wb-ring);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  width: 100%;
  padding: .82rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--wb-radius-sm);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .05s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  margin-top: .3rem;
  color: #fff;
  background: linear-gradient(180deg, #12af6c, var(--wb-green));
  box-shadow: 0 10px 20px -12px rgba(11, 158, 95, .9);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--wb-green), var(--wb-green-deep)); }

.btn-google {
  color: var(--wb-ink);
  background: #fff;
  border-color: var(--wb-line);
}
.btn-google:hover { background: #f6f8f9; border-color: #cfd6db; }
.btn-google svg { width: 18px; height: 18px; flex: none; }

.link {
  color: var(--wb-green);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
}
.link:hover { text-decoration: underline; }

#link-reset {
  display: inline-block;
  margin-top: .85rem;
  align-self: flex-start;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: #9aa4ad;
  margin: 1.4rem 0;
  font-size: .8rem;
  letter-spacing: .04em;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--wb-line);
}
.divider span { padding: 0 .85rem; }

.switch {
  margin-top: 1.5rem;
  color: var(--wb-ink-soft);
  font-size: .9rem;
}

.message {
  margin-top: 1.1rem;
  padding: .7rem .85rem;
  border-radius: var(--wb-radius-sm);
  font-size: .88rem;
  line-height: 1.4;
}
.message.error {
  color: #8f291f;
  background: #fdecea;
  border: 1px solid #f5c6c0;
}
.message.info {
  color: #0a6b41;
  background: #e7f7ef;
  border: 1px solid #b9e6cf;
}

/* ===================== páginas de estado (403/404) ================ */
.status {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background:
    radial-gradient(80% 50% at 50% 0%, #ffffff 0%, var(--wb-bg) 70%);
}

.status-card {
  width: 100%;
  max-width: 440px;
  background: var(--wb-surface);
  border: 1px solid var(--wb-line);
  border-radius: var(--wb-radius);
  box-shadow: var(--wb-shadow);
  padding: 2.75rem 2.5rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.status-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--wb-green-bright), var(--wb-green), var(--wb-green-deep));
}

.status-logo { width: 142px; height: auto; margin-bottom: 1.75rem; }

.status-code {
  font-size: 3.6rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--wb-green);
}
.status-flat {
  display: block;
  width: 150px;
  height: 26px;
  margin: 1rem auto .25rem;
  color: #c4ccd3;
}
.status-flat path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status-title {
  margin-top: 1rem;
  font-size: 1.25rem;
  font-weight: 600;
}
.status-text {
  margin-top: .6rem;
  color: var(--wb-ink-soft);
  font-size: .95rem;
  line-height: 1.55;
}
.status-text strong { color: var(--wb-ink); font-weight: 600; }
.status-meta {
  margin-top: 1.1rem;
  font-size: .85rem;
  color: var(--wb-ink-soft);
  word-break: break-word;
}
.status-meta code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  background: var(--wb-bg);
  border: 1px solid var(--wb-line);
  border-radius: 6px;
  padding: .12rem .4rem;
  color: var(--wb-ink);
}

.status-action {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-top: 1.85rem;
  padding: .72rem 1.4rem;
  border-radius: var(--wb-radius-sm);
  background: linear-gradient(180deg, #12af6c, var(--wb-green));
  color: #fff;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  box-shadow: 0 10px 20px -12px rgba(11, 158, 95, .9);
  transition: background .15s ease;
}
.status-action:hover { background: linear-gradient(180deg, var(--wb-green), var(--wb-green-deep)); }

/* ============================ responsive ========================== */
@media (max-width: 880px) {
  .brand { display: none; }
  .auth {
    background: var(--wb-bg);
    align-items: flex-start;
    padding-top: clamp(2.5rem, 9vh, 6rem);
  }
  .auth-box {
    background: var(--wb-surface);
    border: 1px solid var(--wb-line);
    border-radius: var(--wb-radius);
    box-shadow: var(--wb-shadow);
    padding: 2.25rem 1.75rem;
  }
  .auth-logo { display: block; }
}

/* ========================= accesibilidad ========================== */
:where(a, button, input):focus-visible {
  outline: 2px solid var(--wb-green);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
