:root {
  /* Marca JDV — azul cian */
  --sage: #1fb0ef;          /* color primario de marca */
  --sage-dark: #0e8fce;     /* hover / acento oscuro */
  --sage-light: #e7f6fe;    /* tinte claro (fondos, hover) */
  --brand: #1fb0ef;
  --brand-dark: #0e8fce;
  --brand-2: #38c0f7;
  /* Acento cálido (pendientes / avisos) */
  --terracotta: #f59e0b;
  --terracotta-dark: #d97706;
  /* Neutros y fondos (aire Apple: blancos limpios y grises fríos) */
  --cream: #f5f7fa;
  --sand: #eef2f6;
  --ink: #0a1722;
  --ink-soft: #5b6b76;
  --muted: #8b9aa5;
  --line: #e3e9ef;
  --line-soft: #eef2f6;
  --white: #ffffff;
  /* Estados */
  --danger: #e5484d;
  --danger-bg: #fdecec;
  --success: #12a150;
  --success-bg: #e6f6ec;
  --warning: #d97706;
  --warning-bg: #fef4e3;
  /* Formas */
  --radius: 12px;
  --radius-lg: 20px;
  --radius-pill: 980px;
  --shadow-sm: 0 1px 3px rgba(15,40,60,0.06), 0 8px 24px rgba(15,40,60,0.05);
  --shadow-md: 0 10px 30px rgba(15,40,60,0.10);
  --shadow-lg: 0 24px 60px rgba(15,40,60,0.16);
  /* Tipografía del sistema (SF Pro en Apple) */
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
}

/* ===== Modo noche (por defecto en la app) =====
   Sin atributo data-theme o data-theme="dark" => oscuro.
   data-theme="light" => usa el :root de arriba (modo día). */
:root[data-theme="light"] { color-scheme: light; }
:root:not([data-theme]),
:root[data-theme="dark"] {
  color-scheme: dark;
  --cream: #0d1620;         /* fondo de página */
  --sand: #17232f;          /* hover secundario */
  --white: #17232f;         /* tarjetas, inputs, modales */
  --ink: #eef4f8;           /* texto principal */
  --ink-soft: #a9b8c3;      /* texto secundario */
  --muted: #7f8f9b;         /* texto tenue */
  --line: #263644;          /* bordes */
  --line-soft: #1c2833;     /* bordes suaves */
  --sage-light: #10222e;    /* tinte cian oscuro (fondos/hover) */
  --danger-bg: #3a1d1f;
  --success-bg: #123026;
  --warning-bg: #3a2c14;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.35);
  --shadow-md: 0 10px 30px rgba(0,0,0,0.5);
  --shadow-lg: 0 24px 60px rgba(0,0,0,0.6);
}
/* Mensajes legibles en oscuro */
:root:not([data-theme]) .msg-success,
:root[data-theme="dark"] .msg-success { color: #6ee7a8; }
:root:not([data-theme]) .msg-error,
:root[data-theme="dark"] .msg-error { color: #ff9ea1; }
:root:not([data-theme]) .msg-info,
:root[data-theme="dark"] .msg-info { color: #7fd3ff; }
/* Botón secundario un poco más marcado en oscuro */
:root:not([data-theme]) .btn-secondary:hover,
:root[data-theme="dark"] .btn-secondary:hover { background: #223142; }

/* Botón flotante de cambio día/noche */
#theme-toggle:hover { transform: translateY(-2px); }
#theme-toggle:active { transform: translateY(0); }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; color: var(--ink); letter-spacing: -0.021em; line-height: 1.15; }
h1 { letter-spacing: -0.03em; }
a { color: var(--brand-dark); }
.hidden { display: none !important; }

/* Logo */
.brand-logo { display: inline-block; border-radius: 22px; box-shadow: var(--shadow-md); }

/* Form */
.field { margin-bottom: 16px; }
label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft);
  letter-spacing: 0; text-transform: none; margin-bottom: 7px; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="date"], input[type="time"], input[type="number"], select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--font-body); font-size: 0.98rem; background: var(--white); color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(31,176,239,0.15); }
textarea { resize: vertical; min-height: 64px; }

/* Botones — pastilla estilo Apple */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px; border: 1px solid transparent; border-radius: var(--radius-pill);
  font-family: var(--font-body); font-size: 0.94rem; font-weight: 600; cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.18s, background 0.18s, opacity 0.15s; text-decoration: none; line-height: 1.2;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(31,176,239,0.28); }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); box-shadow: 0 10px 24px rgba(31,176,239,0.36); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.btn-secondary { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--sand); border-color: var(--line); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #0e8a44; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #cf3b40; }
.btn-ghost { background: transparent; color: var(--brand-dark); }
.btn-ghost:hover { background: var(--sage-light); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

/* Cards — más redondeadas, sombra suave, más aire */
.card { background: var(--white); border-radius: var(--radius-lg); padding: 26px; border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm); margin-bottom: 16px; }

/* Mensajes */
.msg { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 14px; font-size: 0.9rem; }
.msg-success { background: var(--success-bg); color: #0e7a3c; border-left: 3px solid var(--success); }
.msg-error { background: var(--danger-bg); color: #c0343a; border-left: 3px solid var(--danger); }
.msg-info { background: var(--sage-light); color: var(--brand-dark); border-left: 3px solid var(--brand); }
