/* ==========================================================================
   ToWork — Design System (ui.css)
   Sistema visual unificado. Inspiración: marketplace de servicios limpio,
   minimalista, mobile-first. Marca ToWork = naranja. Bilingüe EN/ES.
   Cárgalo en cada página: <link rel="stylesheet" href="/ui.css">
   ========================================================================== */

:root {
  /* Marca */
  --tw-orange: #FF6B00;
  --tw-orange-600: #E85D00;
  --tw-orange-50: #FFF3EA;
  --tw-navy: #10233B;      /* textos fuertes / footer */
  --tw-navy-700: #1C3A5E;

  /* Neutros */
  --tw-ink: #14181F;       /* texto principal */
  --tw-muted: #5B6774;     /* texto secundario */
  --tw-line: #E7EBF0;      /* bordes */
  --tw-bg: #FFFFFF;
  --tw-bg-soft: #F6F8FB;   /* fondos de sección */
  --tw-gold: #FFB400;      /* estrellas */
  --tw-green: #1FA463;     /* éxito / verificado */
  --tw-red: #E23D3D;

  /* Forma */
  --tw-r-sm: 10px;
  --tw-r: 16px;
  --tw-r-lg: 22px;
  --tw-r-pill: 999px;
  --tw-shadow: 0 6px 24px rgba(16,35,59,.08);
  --tw-shadow-lg: 0 18px 50px rgba(16,35,59,.14);
  --tw-ring: 0 0 0 4px rgba(255,107,0,.18);

  --tw-maxw: 1160px;
  --tw-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--tw-font);
  color: var(--tw-ink);
  background: var(--tw-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* Layout ------------------------------------------------------------------ */
.tw-container { width: 100%; max-width: var(--tw-maxw); margin: 0 auto; padding: 0 20px; }
.tw-section { padding: 64px 0; }
.tw-section--soft { background: var(--tw-bg-soft); }
.tw-center { text-align: center; }

/* Tipografía -------------------------------------------------------------- */
.tw-h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); line-height: 1.08; font-weight: 800; letter-spacing: -.02em; margin: 0 0 16px; }
.tw-h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -.015em; margin: 0 0 12px; }
.tw-h3 { font-size: 1.2rem; font-weight: 700; margin: 0 0 8px; }
.tw-lead { font-size: clamp(1.02rem, 1.6vw, 1.22rem); color: var(--tw-muted); margin: 0 0 24px; }
.tw-eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--tw-orange); }
.tw-muted { color: var(--tw-muted); }

/* Botones ----------------------------------------------------------------- */
.tw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: inherit; font-size: 1rem; font-weight: 700; cursor: pointer;
  padding: 14px 26px; border-radius: var(--tw-r-pill); border: 1.5px solid transparent;
  transition: transform .06s ease, background .2s ease, box-shadow .2s ease;
  min-height: 48px; text-align: center;
}
.tw-btn:active { transform: translateY(1px); }
.tw-btn--primary { background: var(--tw-orange); color: #fff; box-shadow: 0 8px 20px rgba(255,107,0,.28); }
.tw-btn--primary:hover { background: var(--tw-orange-600); }
.tw-btn--ghost { background: #fff; color: var(--tw-ink); border-color: var(--tw-line); }
.tw-btn--ghost:hover { border-color: var(--tw-orange); color: var(--tw-orange); }
.tw-btn--dark { background: var(--tw-navy); color: #fff; }
.tw-btn--block { width: 100%; }
.tw-btn:disabled { opacity: .6; cursor: not-allowed; }

/* Cards ------------------------------------------------------------------- */
.tw-card { background: #fff; border: 1px solid var(--tw-line); border-radius: var(--tw-r); box-shadow: var(--tw-shadow); }
.tw-card--pad { padding: 24px; }
.tw-card--hover { transition: transform .15s ease, box-shadow .15s ease; }
.tw-card--hover:hover { transform: translateY(-4px); box-shadow: var(--tw-shadow-lg); }

/* Formularios ------------------------------------------------------------- */
.tw-field { margin-bottom: 16px; }
.tw-label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 7px; color: var(--tw-ink); }
.tw-input, .tw-select, .tw-textarea {
  width: 100%; font-family: inherit; font-size: 16px; /* 16px evita zoom iOS */
  color: var(--tw-ink); background: #fff;
  border: 1.5px solid var(--tw-line); border-radius: var(--tw-r-sm);
  padding: 13px 14px; min-height: 48px; transition: border-color .15s, box-shadow .15s;
}
.tw-input:focus, .tw-select:focus, .tw-textarea:focus { outline: none; border-color: var(--tw-orange); box-shadow: var(--tw-ring); }
.tw-input-group { display: flex; }
.tw-input-group .tw-prefix { display: flex; align-items: center; padding: 0 12px; background: var(--tw-bg-soft); border: 1.5px solid var(--tw-line); border-right: 0; border-radius: var(--tw-r-sm) 0 0 var(--tw-r-sm); font-weight: 600; color: var(--tw-muted); }
.tw-input-group .tw-input { border-radius: 0 var(--tw-r-sm) var(--tw-r-sm) 0; }

/* Tabs (segmented) -------------------------------------------------------- */
.tw-tabs { display: flex; gap: 6px; background: var(--tw-bg-soft); padding: 6px; border-radius: var(--tw-r-pill); margin-bottom: 22px; }
.tw-tab { flex: 1; text-align: center; padding: 11px 12px; border-radius: var(--tw-r-pill); font-weight: 700; color: var(--tw-muted); cursor: pointer; border: none; background: transparent; font-family: inherit; font-size: .96rem; transition: all .15s; }
.tw-tab.is-active { background: #fff; color: var(--tw-orange); box-shadow: var(--tw-shadow); }

/* Badges / estrellas ------------------------------------------------------ */
.tw-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--tw-r-pill); font-size: .8rem; font-weight: 700; }
.tw-badge--green { background: rgba(31,164,99,.12); color: var(--tw-green); }
.tw-badge--gray { background: var(--tw-bg-soft); color: var(--tw-muted); }
.tw-badge--orange { background: var(--tw-orange-50); color: var(--tw-orange-600); }
.tw-stars { color: var(--tw-gold); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }

/* Alertas ----------------------------------------------------------------- */
.tw-alert { border-radius: var(--tw-r-sm); padding: 13px 15px; font-size: .94rem; margin: 12px 0; display: none; }
.tw-alert--error { background: rgba(226,61,61,.1); color: #b71c1c; }
.tw-alert--ok { background: rgba(31,164,99,.12); color: #12703f; }
.tw-alert.is-show { display: block; }

/* Header ------------------------------------------------------------------ */
.tw-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.9); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--tw-line); }
.tw-header__row { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.tw-logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; color: var(--tw-ink); }
.tw-logo i { color: var(--tw-orange); }
.tw-logo b { color: var(--tw-orange); font-weight: 800; }
.tw-nav { display: flex; align-items: center; gap: 10px; }
.tw-lang { display: flex; gap: 4px; }
.tw-lang button { border: 1px solid var(--tw-line); background: #fff; color: var(--tw-muted); border-radius: var(--tw-r-pill); padding: 6px 11px; font-weight: 700; cursor: pointer; font-size: .82rem; }
.tw-lang button.is-active { background: var(--tw-orange); color: #fff; border-color: var(--tw-orange); }

/* Grid utilidades --------------------------------------------------------- */
.tw-grid { display: grid; gap: 18px; }
.tw-grid--cats { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.tw-grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* Footer ------------------------------------------------------------------ */
.tw-footer { background: var(--tw-navy); color: #cdd7e4; padding: 56px 0 28px; }
.tw-footer a { color: #cdd7e4; }
.tw-footer a:hover { color: #fff; }

/* Helpers i18n ------------------------------------------------------------ */
[data-lang-hide="es"] { }
.tw-hide { display: none !important; }

@media (max-width: 640px) {
  .tw-section { padding: 44px 0; }
  .tw-nav .tw-btn { padding: 10px 16px; }
}
