/* ============================================================
   FilexFlow - Layout global
   Se usa como base para todos los .html
   ============================================================ */

/* Variables base (modo claro por defecto) */
:root {
  --bg: #f5f7fb;
  --card-bg: #ffffff;

  --primary: #2563eb;
  --primary-soft: rgba(37, 99, 235, 0.12);

  --text: #0f172a;
  --text-soft: #6b7280;

  --border-subtle: rgba(15, 23, 42, 0.08);

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;

  --shadow-soft: 0 20px 60px rgba(15, 23, 42, 0.12);
  --shadow-card: 0 24px 70px rgba(15, 23, 42, 0.18);

  --input-bg: #ffffff;
  --input-border: rgba(148, 163, 184, 0.45);
  --border-color: var(--border-subtle);
  --accent-color: #4ACBFF;

}

/* Modo dark (por defecto en el body) */
body[data-theme="dark"] {
  --bg: #020617;
  --card-bg: #020617;

  --primary: #3b82f6;
  --primary-soft: rgba(59, 130, 246, 0.18);

  --text: #e5e7eb;
  --text-soft: #9ca3af;

  --border-subtle: rgba(148, 163, 184, 0.28);

  --shadow-soft: 0 24px 80px rgba(0, 0, 0, 0.75);
  --shadow-card: 0 30px 100px rgba(0, 0, 0, 0.9);

  --input-bg: rgba(15, 23, 42, 0.9);
  --input-border: rgba(148, 163, 184, 0.5);
  --border-color: var(--border-subtle);
  --accent-color: #4ACBFF;

}

/* ============================================================
   Reset & base
   ============================================================ */

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

html,
body {
  height: 100%;
}

/* Fondo general */
body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at top left, #111827 0%, #020617 55%, #000 100%);
  color: var(--text);
}

/* LIGHT MODE — mismo color que header/subnav/card-left */
body[data-theme="light"] {
  background: #f9fafb;
}

/* Wrapper general */
.page {
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

body[data-theme="light"] .page {
  background: transparent;
}

/* Links */
a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

/* Utilidades */
.text-soft {
  color: var(--text-soft);
  font-size: 0.9rem;
}

/* ============================================================
   HEADER
   ============================================================ */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.42);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(24px);
}

/* Right cluster (auth + theme + language) */
.header-right{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width: 0;
  flex-wrap: nowrap;
}

/* Header en LIGHT = mismo color que subnav/card-left */
body[data-theme="light"] .header {
  background: #f9fafb;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.14);
}

/* Logo según tema */
.header-logo a {
  display: flex;
  align-items: center;
}

.header-logo-img {
  height: 32px;
}

.logo-light {
  display: none;
}

.logo-dark {
  display: block;
}

body[data-theme="light"] .logo-light {
  display: block;
}

body[data-theme="light"] .logo-dark {
  display: none;
}

/* Navegación principal */
.header-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.92rem;
}

.header-nav-link {
  padding: 6px 0;
  color: var(--text-soft);
}

.header-nav-link:hover {
  color: var(--text);
}

/* ============================================================
   SUBNAV
   ============================================================ */

.subnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(28px);
}

/* Light: mismo lenguaje visual que header/card-left */
body[data-theme="light"] .subnav {
  background: #f9fafb;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.14);
}

.subnav-left,
.subnav-center,
.subnav-right {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0; /* allows right side to shrink (prevents wrapping) */
}

/* Keep subnav links in one row on desktop */
.subnav-left{
  flex-wrap: nowrap;
  overflow-x: auto;
  white-space: nowrap;
  gap: 12px;
  min-width: 0;
}
.subnav-left::-webkit-scrollbar{ display:none; }

/* If subnav-right becomes empty after JS normalization, hide it */
.subnav-right:empty{ display:none; }

/* Tabs */
.subnav-link {
  font-size: 0.88rem;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--text-soft);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease,
    transform 0.08s ease;
  flex: 0 0 auto;
}

/* TAB ACTIVO = mismo estilo que CTA azul */
.subnav-link-active {
  background: #2563eb;
  color: #f9fafb;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.6);
}

.subnav-link-active:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.75);
}

/* Hover de tabs inactivos */
.subnav-link:not(.subnav-link-active):hover {
  background: rgba(15, 23, 42, 0.7);
  color: #f9fafb;
}

/* ============================================================
   PILLS: selector de idioma + toggle Dark/Light
   ============================================================ */

/* Selector idioma (EN / ES / PT)
   - Tipo píldora como Converter (azul)
   - Sin sombra */
.lang-select {
  border-radius: var(--radius-pill);
  padding: 6px 18px;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #f9fafb;
  font-size: 0.78rem;
  appearance: none;
  outline: none;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

.lang-select:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  transform: translateY(-1px);
}

/* Toggle tema (contenedor) - sin sombra */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: 3px;
  background: #0b1120;
  border: 1px solid rgba(148, 163, 184, 0.6);
  cursor: pointer;
  font-size: 0.78rem;
  box-shadow: none;
}

/* Pastillas internas Dark/Light */
.theme-toggle-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease,
    transform 0.08s ease;
  color: #e5e7eb; /* gris claro por defecto */
}

.theme-toggle-icon {
  font-size: 0.84rem;
}

/* === ESTADOS SEGÚN TEMA === */

/* Tema DARK:
   - "Dark" activo: fondo azul, texto blanco
   - "Light" inactivo: fondo transparente, texto gris claro */
body[data-theme="dark"] .theme-toggle-pill-dark {
  background: #2563eb;
  color: #ffffff;
}

body[data-theme="dark"] .theme-toggle-pill-light {
  background: transparent;
  color: #e5e7eb;
}

/* Tema LIGHT:
   - "Light" activo: fondo azul, texto blanco
   - "Dark" inactivo: fondo transparente, texto gris claro
   (nada de texto azul) */
body[data-theme="light"] .theme-toggle-pill-light {
  background: #2563eb;
  color: #ffffff;
}

body[data-theme="light"] .theme-toggle-pill-dark {
  background: transparent;
  color: #e5e7eb;
}

/* ============================================================
   AUTH
   ============================================================ */

.header-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  flex-wrap: nowrap;
}

.header-auth-link {
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  color: var(--text-soft);
}

/* === ESTILO ÚNICO DE BOTÓN CTA (Create account, Sign up free, etc.) === */

.btn-primary,
.header-auth-btn {
  border-radius: 999px;
  padding: 10px 20px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  background: #2563eb;
  color: #f9fafb;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.55);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  white-space: nowrap;
}

.btn-primary:hover,
.header-auth-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.75);
}

/* Usuario logueado */
.fx-auth-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  min-width: 0;
}

.header-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.5);

  max-width: 360px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}

.header-user-name {
  font-weight: 500;
  font-size: 0.86rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 240px;
  display: inline-block;
  vertical-align: middle;
  min-width: 0;
}

.header-user-credits {
  font-size: 0.74rem;
  color: #a5b4fc;
  white-space: nowrap;
}

.fx-signout-btn {
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: transparent;
  color: var(--text-soft);
  padding: 5px 12px;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}

.fx-signout-btn:hover {
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
}

/* ============================================================
   MAIN LAYOUT (dos columnas)
   ============================================================ */

.layout,
.layout-main {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 26px;
  margin-top: 6px;
}

/* Card base */
.card {
  border-radius: 32px;
  padding: 26px 26px 24px;
  background: radial-gradient(circle at top left, #0b1120 0%, #020617 55%, #020617 100%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #e5e7eb;
  box-shadow: var(--shadow-card);
}

/* Card izquierdo en dark */
.card-left {
  background: radial-gradient(circle at top left, #0b1120 0%, #020617 40%, #020617 100%);
}

/* Card izquierdo en light = mismo color que background/subnav/header */
body[data-theme="light"] .card-left {
  background: #f9fafb;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

body[data-theme="light"] .card-left .card-subtitle,
body[data-theme="light"] .card-left .card-list li {
  color: #4b5563;
}

body[data-theme="light"] .card-left .card-list li::before {
  color: #2563eb;
}

/* Card derecho en dark */
body[data-theme="dark"] .card-right {
  background: radial-gradient(circle at top right, #111827 0%, #020617 55%, #000 100%);
}

/* Card derecho en light: oscuro elegante */
body[data-theme="light"] .card-right {
  background: radial-gradient(circle at top left, #0b1120 0%, #020617 55%, #020617 100%);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

/* ============================================================
   FORM & TEXTOS
   ============================================================ */

.hero-label {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-self: flex-start;
  text-transform: uppercase;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  font-size: 0.75rem;
  margin-bottom: 20px;
}

.hero-label-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
}

.card-title {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.card-subtitle {
  font-size: 0.96rem;
  color: rgba(148, 163, 184, 0.95);
}

.card-list {
  margin-top: 18px;
  list-style: none;
}

.card-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.9rem;
  color: rgba(148, 163, 184, 0.9);
  margin-bottom: 6px;
}

.card-list li::before {
  content: "•";
  color: #a5b4fc;
  margin-top: 1px;
}

/* FORM STACK – más aire entre label e input */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 22px;
}

.form-label {
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.96);
  margin-bottom: 6px;
}

/* Inputs más altos y elegantes */
.form-input {
  width: 100%;
  border-radius: 999px;
  padding: 12px 18px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.86rem;
  outline: none;
}

.form-input::placeholder {
  color: rgba(148, 163, 184, 0.8);
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  margin-top: 28px;
  font-size: 0.8rem;
  color: var(--text-soft);
  text-align: center;
}

/* ============================================================
   Ajustes responsive generales para móvil
   ============================================================ */

@media (max-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .header-user-pill { max-width: 300px; }
  .header-user-name { max-width: 200px; font-size: 0.84rem; }

  /* Subnav puede scrollear si no cabe */
  .subnav-left{
    overflow-x: auto;
    flex-wrap: nowrap;
  }
}

/* Header & subnav: en móvil sí permitimos wrap */
@media (max-width: 768px) {
  .header {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .header-right{
    flex-wrap: wrap;
    row-gap: 8px;
    justify-content: flex-end;
    width: 100%;
  }

  .subnav {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .subnav-left,
  .subnav-right {
    flex-wrap: wrap;
    row-gap: 6px;
  }
}

/* ================================
   GLOBAL FOOTER (CENTERED)
   ================================ */

.fx-footer {
  width: 100%;
  padding: 28px 0;
  margin-top: 60px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: center;
}

.fx-footer-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 14px;
  opacity: 0.85;
}

.fx-footer-text {
  font-weight: 400;
}

.fx-footer a {
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease, opacity 0.2s ease;
  opacity: 0.85;
}

.fx-footer a:hover {
  opacity: 1;
  color: var(--accent-color);
}

/* Separator – Azul elegante del logo */
.fx-footer-separator {
  font-weight: 600;
  opacity: 0.75;
  color: #4ACBFF;
}

/* Dark mode */
body[data-theme="dark"] .fx-footer,
body[data-theme="dark"] .fx-footer a,
body[data-theme="dark"] .fx-footer-text {
  color: #e5e5e5;
}

/* Light mode */
body[data-theme="light"] .fx-footer,
body[data-theme="light"] .fx-footer a,
body[data-theme="light"] .fx-footer-text {
  color: #2b2b2b;
}

/* Keep these aligned with our “no wrap on desktop” rule */
.subnav-left { flex-wrap: nowrap; gap: 12px; }
.subnav-link { display: inline-flex; align-items: center; }
