/* ============================================================
   PRODUCT RESPONSE ENGINE — Design System
   Variables: Light & Dark Themes
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap");

/* ── Root: shared tokens ───────────────────────────────────── */
:root {
  --font-display: "Syne", sans-serif;
  --font-body: "DM Sans", sans-serif;

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* Type scale */
  --text-xs: 0.72rem;
  --text-sm: 0.85rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.35rem;
  --text-xl: 1.75rem;
  --text-2xl: 2.25rem;
  --text-3xl: 3rem;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 999px;

  /* Transitions */
  --t-fast: 150ms ease;
  --t-base: 250ms ease;
  --t-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Accent — brand color (works on both themes) */
  --accent: #00c896;
  --accent-dim: #00c89620;
  --accent-hover: #00b085;
  --accent-text: #007a5a;
}

/* ============================================================
   LIGHT THEME — evoca productividad
   Filosofía: espacio limpio, tipografía protagonista,
   calidez sin distracción.
   ============================================================ */
[data-theme="light"] {
  color-scheme: light;

  /* Backgrounds */
  --bg-base: #f7f6f3;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-subtle: #efede8;
  --bg-inset: #e8e5df;

  /* Text */
  --text-primary: #1a1916;
  --text-secondary: #5c5852;
  --text-tertiary: #9c9790;
  --text-inverse: #ffffff;

  /* Borders */
  --border-color: rgba(28, 24, 18, 0.1);
  --border-color-md: rgba(28, 24, 18, 0.18);
  --border: 1px solid var(--border-color);
  --border-md: 1px solid var(--border-color-md);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);

  /* Interactive */
  --input-bg: #ffffff;
  --input-border: rgba(28, 24, 18, 0.15);
  --input-focus: var(--accent);

  /* Accent override for light (slightly deeper) */
  --accent-text: #007a5a;

  /* Status */
  --success: #16a34a;
  --warning: #d97706;
  --error: #dc2626;
}

/* ============================================================
   DARK THEME — resalta el color corporativo
   Filosofía: fondo que desaparece, el color del cliente
   protagoniza, ambiente premium.
   ============================================================ */
[data-theme="dark"] {
  color-scheme: dark;

  /* Backgrounds */
  --bg-base: #0f0f0e;
  --bg-surface: #181816;
  --bg-elevated: #212120;
  --bg-subtle: #2a2a27;
  --bg-inset: #323230;

  /* Text */
  --text-primary: #f0eee8;
  --text-secondary: #a8a49c;
  --text-tertiary: #6b6762;
  --text-inverse: #0f0f0e;

  /* Borders */
  --border-color: rgba(240, 238, 232, 0.08);
  --border-color-md: rgba(240, 238, 232, 0.14);
  --border: 1px solid var(--border-color);
  --border-md: 1px solid var(--border-color-md);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4), 0 1px 4px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);

  /* Interactive */
  --input-bg: #212120;
  --input-border: rgba(240, 238, 232, 0.12);
  --input-focus: var(--accent);

  /* Status */
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
}

/* ============================================================
   BASE — Reset y estilos globales
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 300;
  color: var(--text-primary);
  background-color: var(--bg-base);
  line-height: 1.6;
  min-height: 100vh;
  transition:
    background-color var(--t-slow),
    color var(--t-base);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t-fast);
}

a:hover {
  color: var(--accent-hover);
}

img {
  display: block;
  max-width: 100%;
}

/* ── Typography ─────────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: var(--sp-3) var(--sp-6);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  text-decoration: none;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 200, 150, 0.3);
}
.btn--primary:active {
  transform: translateY(0);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: var(--border-md);
}
.btn--ghost:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.btn--full {
  width: 100%;
}

/* ── Form elements ─────────────────────────────────────────── */
.input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 300;
  color: var(--text-primary);
  outline: none;
  transition:
    border-color var(--t-fast),
    box-shadow var(--t-fast);
}

.input::placeholder {
  color: var(--text-tertiary);
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition:
    background var(--t-base),
    border-color var(--t-base),
    box-shadow var(--t-fast);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* ── Theme toggle pill ────────────────────────────────────── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--bg-inset);
  border: var(--border);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.theme-toggle__btn {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--t-fast);
}

.theme-toggle__btn.is-active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.theme-toggle__btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color-md);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ── Utility ────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-accent {
  color: var(--accent);
}
.text-secondary {
  color: var(--text-secondary);
}
.text-tertiary {
  color: var(--text-tertiary);
}
.font-display {
  font-family: var(--font-display);
}
