/* =========================================================
   EnerVision Lite — Shared theme
   Hereda variables, tipografía y componentes de la landing.
   ========================================================= */

:root {
  --bg: #0B0F10;
  --bg-2: #0F1416;
  --bg-3: #151B1D;
  --fg: #F6F5F1;
  --fg-dim: #A8ADA8;
  --fg-mute: #6B716D;
  --rule: #232A2C;
  --rule-strong: #2E3638;
  --accent: oklch(0.88 0.18 130);
  --accent-ink: #0A1000;
  --warn: oklch(0.78 0.14 60);
  --danger: oklch(0.70 0.18 25);
  --ok: oklch(0.82 0.14 150);
}

html[data-theme="light"] {
  --bg: #F6F5F1;
  --bg-2: #EEECE4;
  --bg-3: #E4E2D8;
  --fg: #0B0F10;
  --fg-dim: #3B4240;
  --fg-mute: #6B716D;
  --rule: #D8D5C9;
  --rule-strong: #BEBBAE;
  --accent: oklch(0.68 0.19 130);
  --accent-ink: #0A1000;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg); color: var(--fg);
  font-family: "Geist", system-ui, sans-serif;
  font-feature-settings: "ss01", "cv11";
}
body { min-height: 100vh; transition: background .4s ease, color .4s ease; }
a { color: inherit; text-decoration: none; }

.mono { font-family: "Geist Mono", ui-monospace, monospace; font-feature-settings: "ss01"; }
.serif { font-family: "Instrument Serif", serif; font-weight: 400; }
.eyebrow {
  font-family: "Geist Mono", monospace;
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-mute);
}

/* ---------- LOGO ---------- */
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.logo-mark {
  width: 22px; height: 22px; position: relative;
  background: var(--accent); border-radius: 3px;
  display: grid; place-items: center;
}
.logo-mark::before {
  content: ""; width: 8px; height: 12px;
  background: var(--accent-ink);
  clip-path: polygon(55% 0, 0 60%, 45% 60%, 30% 100%, 100% 40%, 55% 40%);
}
.logo-tag {
  font-family: "Geist Mono", monospace; font-size: 10px;
  letter-spacing: 0.08em; padding: 2px 6px;
  border: 1px solid var(--rule-strong); border-radius: 3px;
  color: var(--fg-dim); text-transform: uppercase; margin-left: 4px;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 4px;
  font-family: "Geist", sans-serif; font-size: 13.5px; font-weight: 500;
  background: var(--fg); color: var(--bg); border: 1px solid var(--fg);
  cursor: pointer; transition: transform .15s ease, opacity .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--rule-strong); }
.btn-ghost:hover { background: var(--bg-2); }
.btn-accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn-block { width: 100%; padding: 13px 18px; }

/* ---------- LANG / THEME PILL ---------- */
.pill-toggle {
  display: inline-flex; background: var(--bg-2);
  border: 1px solid var(--rule); border-radius: 100px; padding: 3px;
  font-family: "Geist Mono", monospace; font-size: 11px;
}
.pill-toggle button {
  border: 0; background: transparent; color: var(--fg-mute);
  padding: 4px 10px; border-radius: 100px;
  cursor: pointer; letter-spacing: 0.06em;
}
.pill-toggle button.on { background: var(--fg); color: var(--bg); }

/* ---------- AUTH SHELL ---------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 520px) 1fr;
}
@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}

/* LEFT COLUMN — form */
.auth-form-col {
  display: flex; flex-direction: column;
  padding: 28px 56px 40px;
  background: var(--bg);
  position: relative;
}
@media (max-width: 720px) { .auth-form-col { padding: 24px 24px 32px; } }

.auth-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 64px;
}
.auth-top-right { display: flex; gap: 10px; align-items: center; }

.auth-body {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  max-width: 380px; width: 100%; margin: 0 auto;
}
.auth-eyebrow { margin-bottom: 14px; }
.auth-title {
  font-family: "Instrument Serif", serif;
  font-size: clamp(34px, 4vw, 44px);
  line-height: 1.05; letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.auth-title em { font-style: italic; color: var(--accent); }
.auth-sub {
  color: var(--fg-dim); font-size: 14.5px; line-height: 1.55;
  margin-bottom: 36px;
}

/* FORM FIELDS */
.field { margin-bottom: 18px; position: relative; }
.field-label {
  display: flex; justify-content: space-between; align-items: center;
  font-family: "Geist Mono", monospace; font-size: 10.5px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-mute); margin-bottom: 8px;
}
.field-label a { color: var(--fg-dim); text-decoration: none; }
.field-label a:hover { color: var(--accent); }

.field-input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  color: var(--fg);
  font-family: "Geist", sans-serif; font-size: 14.5px;
  padding: 13px 14px; border-radius: 4px;
  transition: border-color .15s ease, background .15s ease;
}
.field-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-3);
}
.field-input::placeholder { color: var(--fg-mute); }

.field-pwd-wrap { position: relative; }
.field-pwd-toggle {
  position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
  background: transparent; border: 0; color: var(--fg-mute);
  cursor: pointer; padding: 6px; font-family: "Geist Mono", monospace;
  font-size: 10px; letter-spacing: 0.08em;
}
.field-pwd-toggle:hover { color: var(--fg); }

.field-error {
  display: none;
  font-family: "Geist Mono", monospace; font-size: 11px;
  color: var(--danger); margin-top: 6px;
}
.field.has-error .field-input { border-color: var(--danger); }
.field.has-error .field-error { display: block; }

.form-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 0 24px; font-size: 13px;
}
.checkbox {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--fg-dim); cursor: pointer; user-select: none;
}
.checkbox input { appearance: none; width: 14px; height: 14px; border: 1px solid var(--rule-strong); border-radius: 3px; background: var(--bg-2); cursor: pointer; position: relative; }
.checkbox input:checked { background: var(--accent); border-color: var(--accent); }
.checkbox input:checked::after {
  content: ""; position: absolute; top: 1px; left: 4px;
  width: 4px; height: 8px;
  border: solid var(--accent-ink); border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* DIVIDER */
.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0; color: var(--fg-mute);
  font-family: "Geist Mono", monospace; font-size: 10.5px;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.divider::before, .divider::after {
  content: ""; flex: 1; border-top: 1px solid var(--rule);
}

/* FOOTER LINK */
.auth-footer {
  margin-top: 28px; text-align: center;
  font-size: 13.5px; color: var(--fg-dim);
}
.auth-footer a { color: var(--fg); border-bottom: 1px solid var(--rule-strong); padding-bottom: 1px; }
.auth-footer a:hover { color: var(--accent); border-color: var(--accent); }

.auth-bottom {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 40px; padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-family: "Geist Mono", monospace; font-size: 10.5px;
  letter-spacing: 0.08em; color: var(--fg-mute);
}

/* RIGHT COLUMN — visual aside */
.auth-aside {
  position: relative;
  background:
    radial-gradient(ellipse 80% 60% at 70% 30%, rgba(184, 232, 62, 0.06), transparent 60%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  border-left: 1px solid var(--rule);
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 32px;
}

/* Grid background — industrial */
.aside-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 80%);
}

.aside-content {
  position: relative;
  display: flex; flex-direction: column; justify-content: center;
  flex: 1;
  max-width: 520px; margin: 0 auto;
}
.aside-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 24px;
  font-family: "Geist Mono", monospace; font-size: 10.5px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
}
.aside-eyebrow::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.aside-headline {
  font-family: "Instrument Serif", serif;
  font-size: clamp(34px, 3.5vw, 48px);
  line-height: 1.08; letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 18px;
}
.aside-headline em { font-style: italic; color: var(--accent); }
.aside-body {
  color: var(--fg-dim); font-size: 14.5px; line-height: 1.55;
  margin-bottom: 32px; max-width: 420px;
}

.aside-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 28px;
}
.aside-stat { padding: 16px 0; }
.aside-stat:not(:last-child) { border-right: 1px solid var(--rule); padding-right: 16px; }
.aside-stat:not(:first-child) { padding-left: 16px; }
.aside-stat .v {
  font-family: "Instrument Serif", serif;
  font-size: 28px; line-height: 1; letter-spacing: -0.01em;
  color: var(--accent); margin-bottom: 6px;
}
.aside-stat .l {
  font-family: "Geist Mono", monospace;
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-mute);
}

/* Mini live ticker bar */
.aside-ticker {
  position: relative;
  border: 1px solid var(--rule); border-radius: 4px;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  padding: 14px 16px;
  font-family: "Geist Mono", monospace; font-size: 11px;
  color: var(--fg-dim);
  display: flex; align-items: center; gap: 14px;
}
.aside-ticker .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 8px var(--ok);
  flex-shrink: 0;
}
.aside-ticker .lbl { color: var(--fg-mute); letter-spacing: 0.08em; text-transform: uppercase; font-size: 10px; }
.aside-ticker .val { color: var(--fg); letter-spacing: -0.005em; }

.aside-foot {
  position: relative;
  display: flex; justify-content: space-between; align-items: center;
  font-family: "Geist Mono", monospace; font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-mute);
}

/* Hide either lang */
html[data-lang="en"] [data-lang-es], html[data-lang="es"] [data-lang-en] { display: none; }
