/* =========================================================================
   AEIOM Deck — Gate / Landing / Status pages
   Soporte completo dark/light theme + i18n
   ========================================================================= */

/* ===== TOKEN SYSTEM (CSS variables, theme-aware) ===== */
:root {
  /* Brand colors — invariantes */
  --aeiom-yellow:  #F2B705;
  --aeiom-cyan:    #2EB6F0;
  --aeiom-magenta: #E5174A;
  --aeiom-light:   #D8DCE0;
  --aeiom-grey:    #5A6470;

  /* Typography */
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --font-serif:   'Instrument Serif', Georgia, serif;

  /* Animation */
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== DARK (default) ===== */
:root,
[data-theme="dark"] {
  --bg-0: #0A0E1A;
  --bg-1: #111827;
  --bg-2: #1A2233;
  --bg-3: #232C42;

  --text-primary:   #F4F6FA;
  --text-secondary: #A6AFBF;
  --text-muted:     #6A7589;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-input:  rgba(255, 255, 255, 0.10);

  --shadow-card: 0 30px 80px rgba(0, 0, 0, 0.4);

  --noise-opacity: 0.5;
  --noise-blend: overlay;

  --bg-grad-1: rgba(46, 182, 240, 0.08);
  --bg-grad-2: rgba(229, 23, 74, 0.06);

  --switcher-bg: rgba(255, 255, 255, 0.04);
  --switcher-active-bg: rgba(255, 255, 255, 0.08);
  --switcher-border: rgba(255, 255, 255, 0.08);

  --code-input-bg: var(--bg-2);
  --color-success: #34D399;
  --color-success-bg: rgba(52, 211, 153, 0.1);
  --color-success-border: rgba(52, 211, 153, 0.3);
  --color-warning: #F2B705;
  --color-warning-bg: rgba(242, 183, 5, 0.1);
  --color-error: #FF6B8A;
  --color-error-bg: rgba(229, 23, 74, 0.08);
  --color-error-border: rgba(229, 23, 74, 0.3);

  --accent: var(--aeiom-cyan);
}

/* ===== LIGHT ===== */
[data-theme="light"] {
  --bg-0: #FAFBFC;
  --bg-1: #FFFFFF;
  --bg-2: #F4F6FA;
  --bg-3: #E8ECF2;

  --text-primary:   #0E1525;
  --text-secondary: #4A5468;
  --text-muted:     #8B95A8;

  --border-subtle: rgba(14, 21, 37, 0.06);
  --border-strong: rgba(14, 21, 37, 0.14);
  --border-input:  rgba(14, 21, 37, 0.12);

  --shadow-card: 0 24px 60px rgba(14, 21, 37, 0.08), 0 2px 8px rgba(14, 21, 37, 0.04);

  --noise-opacity: 0.25;
  --noise-blend: multiply;

  --bg-grad-1: rgba(46, 182, 240, 0.06);
  --bg-grad-2: rgba(229, 23, 74, 0.04);

  --switcher-bg: rgba(14, 21, 37, 0.03);
  --switcher-active-bg: rgba(14, 21, 37, 0.07);
  --switcher-border: rgba(14, 21, 37, 0.08);

  --code-input-bg: #FFFFFF;
  --color-success: #047857;
  --color-success-bg: rgba(4, 120, 87, 0.06);
  --color-success-border: rgba(4, 120, 87, 0.2);
  --color-warning: #B45309;
  --color-warning-bg: rgba(180, 83, 9, 0.06);
  --color-error: #B81138;
  --color-error-bg: rgba(229, 23, 74, 0.05);
  --color-error-border: rgba(229, 23, 74, 0.2);

  --accent: #0EA5E0;
}

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

html, body {
  background: var(--bg-0);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  transition: background-color 0.4s ease, color 0.4s ease;
}

body {
  background-image:
    radial-gradient(ellipse 60% 50% at 30% 0%, var(--bg-grad-1), transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 100%, var(--bg-grad-2), transparent 70%);
  background-attachment: fixed;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: var(--noise-opacity);
  mix-blend-mode: var(--noise-blend);
}

a { color: inherit; text-decoration: none; }

/* =========================================================================
   LAYOUT
   ========================================================================= */
.gate {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.gate__header {
  padding: 24px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.gate__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.gate__brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: block;
}
.gate__brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3em;
  color: var(--text-primary);
}
.gate__brand-name em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text-secondary);
  margin-left: 6px;
  font-size: 15px;
}

.gate__controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.gate__lock {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
}
.gate__lock-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--aeiom-magenta);
  box-shadow: 0 0 12px rgba(229, 23, 74, 0.6);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* ===== Switchers ===== */
.switcher {
  display: inline-flex;
  align-items: center;
  background: var(--switcher-bg);
  border: 1px solid var(--switcher-border);
  border-radius: 999px;
  padding: 3px;
  position: relative;
}
.switcher__btn {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.15em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  padding: 7px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.25s ease, background-color 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 32px;
  text-decoration: none;
  line-height: 1;
}
.switcher__btn:hover {
  color: var(--text-secondary);
}
.switcher__btn--active {
  color: var(--text-primary);
  background: var(--switcher-active-bg);
}
.switcher--theme .switcher__btn {
  padding: 7px 9px;
  min-width: 30px;
}
.switcher--theme svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================================================================
   MAIN
   ========================================================================= */
.gate__main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px 60px;
}

.gate__card {
  width: 100%;
  max-width: 600px;
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
[data-theme="light"] .gate__card {
  background: var(--bg-1);
}
.gate__card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--aeiom-yellow), var(--aeiom-cyan), var(--aeiom-magenta));
}

/* =========================================================================
   TABS
   ========================================================================= */
.gate__tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 8px;
  position: relative;
}
.gate__tab {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 18px 20px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  transition: color 0.3s ease;
}
.gate__tab:hover {
  color: var(--text-secondary);
}
.gate__tab--active {
  color: var(--text-primary);
}
.gate__tab--active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 24px;
  right: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

.gate__pane {
  padding: 36px 40px 40px;
  display: none;
  animation: fadeIn 0.4s var(--ease-out-expo);
}
.gate__pane--active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.gate__eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.gate__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin-bottom: 14px;
  color: var(--text-primary);
}
.gate__title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.gate__lede {
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.6;
  margin-bottom: 28px;
}

/* =========================================================================
   FORM
   ========================================================================= */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}
.field__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 500;
}
.field__input,
.field__textarea {
  font-family: var(--font-display);
  font-size: 15px;
  background: var(--code-input-bg);
  border: 1px solid var(--border-input);
  color: var(--text-primary);
  padding: 13px 16px;
  border-radius: 8px;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  outline: none;
  width: 100%;
}
.field__input::placeholder,
.field__textarea::placeholder {
  color: var(--text-muted);
}
.field__input:focus,
.field__textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 182, 240, 0.12);
}
.field__textarea {
  resize: vertical;
  min-height: 76px;
  line-height: 1.5;
}
.field--row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field__input--code {
  font-family: var(--font-mono);
  font-size: 24px;
  letter-spacing: 0.18em;
  text-align: center;
  padding: 18px 16px;
  font-weight: 600;
  text-transform: uppercase;
}

/* =========================================================================
   NDA BOX
   ========================================================================= */
.nda-box {
  background: var(--code-input-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  margin: 24px 0 16px;
  max-height: 220px;
  overflow-y: auto;
}
.nda-box__inner {
  padding: 20px 24px;
}
.nda-box::-webkit-scrollbar { width: 10px; }
.nda-box::-webkit-scrollbar-track { background: transparent; }
.nda-box::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 5px;
}

.nda-doc h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.nda-doc p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 12px;
}
.nda-doc ol {
  padding-left: 22px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}
.nda-doc ol li { margin-bottom: 10px; }
.nda-doc strong {
  color: var(--text-primary);
  font-weight: 600;
}
.nda-note {
  font-style: italic;
  color: var(--text-muted) !important;
  font-size: 12px !important;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* =========================================================================
   CHECKBOX
   ========================================================================= */
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--code-input-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease;
  margin-bottom: 24px;
  position: relative;
}
.checkbox:hover {
  border-color: var(--border-strong);
}
.checkbox input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.checkbox__box {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  pointer-events: none;
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-0);
  transition: all 0.25s var(--ease-out-expo);
}
.checkbox__box::after {
  content: '';
  width: 11px;
  height: 6px;
  border-left: 2px solid var(--bg-0);
  border-bottom: 2px solid var(--bg-0);
  transform: rotate(-45deg) scale(0);
  transition: transform 0.25s var(--ease-spring);
  margin-bottom: 2px;
}
.checkbox input:checked ~ .checkbox__box {
  background: var(--accent);
  border-color: var(--accent);
}
.checkbox input:checked ~ .checkbox__box::after {
  transform: rotate(-45deg) scale(1);
}
.checkbox__text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.45;
  pointer-events: none;
}
.checkbox__text strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* =========================================================================
   SUBMIT BUTTON
   ========================================================================= */
.btn-submit {
  width: 100%;
  background: var(--text-primary);
  color: var(--bg-0);
  border: none;
  padding: 16px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.3s var(--ease-out-expo),
              box-shadow 0.3s ease,
              opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}
[data-theme="light"] .btn-submit:hover:not(:disabled) {
  box-shadow: 0 16px 32px rgba(14, 21, 37, 0.18);
}
.btn-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-submit__arrow {
  transition: transform 0.3s var(--ease-out-expo);
}
.btn-submit:hover:not(:disabled) .btn-submit__arrow {
  transform: translateX(4px);
}

/* =========================================================================
   ALERTS
   ========================================================================= */
.alert {
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid;
}
.alert--error {
  background: var(--color-error-bg);
  border-color: var(--color-error-border);
  color: var(--color-error);
}
.alert--info {
  background: rgba(46, 182, 240, 0.08);
  border-color: rgba(46, 182, 240, 0.3);
  color: var(--accent);
}
.alert--success {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
  color: var(--color-success);
}

/* =========================================================================
   STATUS PAGES
   ========================================================================= */
.status {
  text-align: center;
  padding: 8px 0;
}
.status__icon {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  margin: 0 auto 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 36px;
  border: 2px solid;
}
.status__icon--pending {
  background: var(--color-warning-bg);
  border-color: var(--color-warning);
  color: var(--color-warning);
  box-shadow: 0 0 40px var(--color-warning-bg);
  animation: pendingPulse 2.5s ease-in-out infinite;
}
.status__icon--approved {
  background: var(--color-success-bg);
  border-color: var(--color-success);
  color: var(--color-success);
  box-shadow: 0 0 40px var(--color-success-bg);
}
.status__icon--denied,
.status__icon--error {
  background: var(--color-error-bg);
  border-color: var(--color-error);
  color: var(--color-error);
  box-shadow: 0 0 40px var(--color-error-bg);
}
@keyframes pendingPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}
.status__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.status__lede {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 24px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}
.status__detail {
  background: var(--code-input-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
  text-align: left;
  max-width: 440px;
  margin: 0 auto;
}
.status__detail strong {
  color: var(--text-primary);
  display: inline-block;
  min-width: 90px;
}

/* =========================================================================
   FOOTER
   ========================================================================= */
.gate__footer {
  padding: 20px 40px 28px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
  text-align: center;
}
.gate__footer-line {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.gate__footer-line span {
  color: var(--border-strong);
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 720px) {
  .gate__header {
    padding: 16px 18px;
    gap: 14px;
  }
  .gate__main { padding: 16px 12px 50px; }
  .gate__card { border-radius: 16px; }
  .gate__tabs { padding: 0 4px; }
  .gate__tab { padding: 16px 8px 14px; font-size: 10px; letter-spacing: 0.15em; }
  .gate__pane { padding: 28px 22px 32px; }
  .field--row { grid-template-columns: 1fr; }
  .field__input--code { font-size: 20px; padding: 16px 12px; }
  .gate__footer { padding: 18px 18px 22px; }
}

@media (max-width: 480px) {
  .gate__brand-name { font-size: 12px; letter-spacing: 0.25em; }
  .gate__brand-name em { display: none; }
  .gate__lock { font-size: 9px; padding: 6px 10px; letter-spacing: 0.15em; }
  .switcher__btn { font-size: 9.5px; padding: 6px 9px; min-width: 28px; }
}

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

*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.checkbox:focus-within {
  outline: 0;
}
