/* fourier.css — tokens y componentes del sistema de diseño (capa-6-diseno.md) */

:root {
  --fc-bg: #f6f8fb;
  --fc-surface: #ffffff;
  --fc-surface-2: #f1f5f9;
  --fc-surface-3: #e2e8f0;
  --fc-border: rgba(15,23,42,0.08);
  --fc-border-strong: rgba(15,23,42,0.14);
  --fc-text: #0f172a;
  --fc-text-2: #334155;
  --fc-muted: #5b6b7f;
  --fc-accent: #06b6d4;
  --fc-accent-hover: #0891b2;
  --fc-accent-deep: #0e7490;
  --fc-on-accent: #04202a;
  --fc-accent-soft: rgba(6,182,212,0.12);
  --fc-success: #10b981;
  --fc-warning: #d97706;
  --fc-danger: #dc2626;
  --fc-font: 'Inter', system-ui, -apple-system, sans-serif;
  --fc-font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --fc-r-sm: 7px;
  --fc-r-md: 9px;
  --fc-r-lg: 12px;
  --fc-r-xl: 16px;
  --fc-r-pill: 999px;
}

* { box-sizing: border-box; }

[x-cloak] { display: none !important; }

html, body { margin: 0; padding: 0; }
body {
  background: var(--fc-bg);
  color: var(--fc-text);
  font-family: var(--fc-font);
  font-size: 15.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--fc-accent); text-decoration: none; }
a:hover { color: var(--fc-accent-hover); }
:focus-visible { outline: 2px solid var(--fc-accent); outline-offset: 2px; }

/* Tipografía */
.fc-display { font-size: clamp(34px, 5vw, 52px); line-height: 1.08; font-weight: 800; letter-spacing: -0.03em; }
h1.fc-h1, .fc-h1 { font-size: clamp(28px, 3vw, 38px); line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; }
.fc-h2 { font-size: 30px; font-weight: 800; }
.fc-h3 { font-size: 17px; font-weight: 600; }
.fc-muted { color: var(--fc-muted); }
.fc-mono { font-family: var(--fc-font-mono); }

/* Cards */
.fc-card {
  background: var(--fc-surface);
  border: 1px solid var(--fc-border);
  border-radius: var(--fc-r-xl);
  padding: 22px;
}
.fc-card--highlight { border: 2px solid var(--fc-accent); position: relative; }
.fc-card--interactive { cursor: pointer; }
.fc-card--interactive:hover { border-color: var(--fc-accent); }
.fc-badge-float {
  position: absolute; top: -12px; left: 18px;
  background: var(--fc-accent); color: var(--fc-on-accent);
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: var(--fc-r-pill);
}

/* Botones */
.fc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--fc-r-md); padding: 10px 18px;
  font-family: var(--fc-font); font-weight: 700; font-size: 14.5px; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.fc-btn--primary { background: var(--fc-accent); color: var(--fc-on-accent); }
.fc-btn--primary:hover { background: var(--fc-accent-hover); }
.fc-btn--secondary { background: transparent; border: 1px solid var(--fc-border-strong); color: var(--fc-text); }
.fc-btn--secondary:hover { border-color: var(--fc-accent); }
.fc-btn--danger { background: transparent; border: 1px solid rgba(248,113,113,.4); color: var(--fc-danger); }
.fc-btn--danger:hover { background: rgba(248,113,113,.08); }
.fc-btn--block { width: 100%; }
.fc-btn:disabled { opacity: .45; cursor: not-allowed; }
.fc-btn--sm { padding: 8px 14px; font-size: 13px; }
.fc-btn--lg { padding: 13px 24px; font-size: 15.5px; border-radius: var(--fc-r-lg); }

/* Badges / chips */
.fc-badge { display: inline-flex; align-items: center; gap: 5px; border-radius: var(--fc-r-pill); padding: 4px 11px; font-size: 12.5px; font-weight: 600; }
.fc-badge--success { background: rgba(52,211,153,.12); color: var(--fc-success); }
.fc-badge--warning { background: rgba(251,191,36,.12); color: var(--fc-warning); }
.fc-badge--danger { background: rgba(248,113,113,.12); color: var(--fc-danger); }
.fc-badge--neutral { background: var(--fc-surface-2); color: var(--fc-text-2); }
.fc-badge--accent { background: var(--fc-accent-soft); color: var(--fc-accent); }
.fc-chip { background: var(--fc-surface-2); color: var(--fc-text-2); padding: 5px 10px; border-radius: 6px; font-size: 12px; }

/* Zona de subida */
.fc-upload {
  border: 2px dashed var(--fc-border-strong);
  border-radius: var(--fc-r-lg);
  padding: 44px 20px; text-align: center; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.fc-upload:hover, .fc-upload.is-dragover { border-color: var(--fc-accent); background: var(--fc-accent-soft); }
.fc-upload__title { font-weight: 600; margin: 14px 0 4px; font-size: 15px; }
.fc-upload__hint { color: var(--fc-muted); font-size: 13px; }

/* Formularios */
.fc-field { display: block; font-size: 13px; color: var(--fc-muted); margin-bottom: 6px; }
.fc-input {
  width: 100%; background: var(--fc-surface); border: 1px solid var(--fc-border-strong);
  color: var(--fc-text); padding: 10px 12px; border-radius: var(--fc-r-md); font-size: 14.5px;
  font-family: var(--fc-font);
}
.fc-input:focus { border-color: var(--fc-accent); outline: none; }
select.fc-input { appearance: auto; }

/* Sliders */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; background: var(--fc-surface-3); border-radius: 2px; outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--fc-accent); cursor: pointer; box-shadow: 0 0 0 4px rgba(6,182,212,.15); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--fc-accent); cursor: pointer; }

/* Tablas */
.fc-table-wrap { overflow-x: auto; background: var(--fc-surface); border: 1px solid var(--fc-border); border-radius: var(--fc-r-lg); }
.fc-table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 13.5px; }
.fc-table th { text-align: left; padding: 12px 18px; font-size: 12px; color: var(--fc-muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; border-bottom: 1px solid var(--fc-border); }
.fc-table td { padding: 13px 18px; border-bottom: 1px solid rgba(15,23,42,.06); color: var(--fc-text-2); }
.fc-table tr:last-child td { border-bottom: 0; }

/* Placeholders de imagen (cero retención: no hay miniaturas) */
.fc-placeholder { border-radius: 8px; background: repeating-linear-gradient(45deg, #e2e8f0, #e2e8f0 10px, #f1f5f9 10px, #f1f5f9 20px); }
.fc-checker { background: repeating-conic-gradient(#e2e8f0 0% 25%, #f1f5f9 0% 50%) 0 0 / 20px 20px; border-radius: 10px; }

/* Sidebar de herramientas */
.fc-sidebar { width: 230px; flex-shrink: 0; border-right: 1px solid var(--fc-border); padding: 26px 16px; }
.fc-sidebar__label { font-size: 11px; font-weight: 700; color: var(--fc-muted); letter-spacing: .05em; text-transform: uppercase; margin: 0 0 8px 10px; }
.fc-sidebar__link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--fc-text-2); }
.fc-sidebar__link:hover { color: var(--fc-text); }
.fc-sidebar__link.is-active { background: var(--fc-accent-soft); color: var(--fc-accent); font-weight: 600; }

/* Sidebar de cuenta */
.fc-nav { display: flex; flex-direction: column; gap: 4px; }
.fc-nav__link { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px; font-size: 14px; color: var(--fc-text-2); }
.fc-nav__link:hover { color: var(--fc-text); }
.fc-nav__link.is-active { background: var(--fc-accent-soft); color: var(--fc-accent); font-weight: 600; }

/* Progreso */
.fc-progress { height: 8px; background: var(--fc-surface-3); border-radius: 99px; overflow: hidden; }
.fc-progress__bar { height: 100%; background: var(--fc-accent); border-radius: 99px; transition: width .18s ease; }

/* Barra de plataforma (dentro de la app: sin navbar/footer de marketing) */
.fc-platform-bar {
  position: sticky; top: 0; z-index: 1050;
  background: var(--fc-bg); border-bottom: 1px solid var(--fc-border);
  padding: 10px 24px;
}
.fc-platform-bar__inner {
  max-width: 1320px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.fc-platform-bar__right { display: flex; align-items: center; gap: 12px; }

/* Toasts */
.fc-toast { position: fixed; top: 18px; right: 18px; z-index: 1200; display: flex; flex-direction: column; gap: 10px; }
.fc-toast__item { background: var(--fc-surface); border: 1px solid var(--fc-border-strong); border-left: 3px solid var(--fc-accent); border-radius: var(--fc-r-md); padding: 12px 16px; font-size: 13.5px; box-shadow: 0 8px 24px rgba(15,23,42,.12); max-width: 360px; }

/* Modal */
.fc-modal { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; z-index: 1100; padding: 20px; }
.fc-modal__card { background: var(--fc-surface); border: 1px solid var(--fc-border-strong); border-radius: var(--fc-r-xl); padding: 28px; max-width: 440px; width: 100%; }

/* Avatares */
.fc-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--fc-surface-2); border: 1px solid var(--fc-border); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }

/* Iconos */
.icon { width: 18px; height: 18px; flex-shrink: 0; color: currentColor; }
.icon--sm { width: 15px; height: 15px; }

@keyframes spin { to { transform: rotate(360deg); } }
.fc-spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--fc-border-strong); border-top-color: var(--fc-accent); border-radius: 50%; animation: spin .8s linear infinite; }

/* Responsive 360px */
@media (max-width: 900px) {
  .fc-sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 240px; background: var(--fc-bg); z-index: 1050; transform: translateX(-100%); transition: transform .2s ease; border-right: 1px solid var(--fc-border); overflow-y: auto; }
  .fc-sidebar.is-open { transform: translateX(0); }
  .fc-sidebar-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 1040; }
}
