/* =====================================================================
   base.css — Estilos base del sitio Factumex
   Paleta institucional: blanco / negro + acento #3882C6
   ===================================================================== */

/* ---- Variables ----------------------------------------------------- */
:root {
  --brand:        #3882C6;
  --brand-dark:   #2c6aa3;
  --brand-light:  #eaf2fb;

  --ink:          #1b1b1b;   /* texto principal (negro suave) */
  --muted:        #6b7280;   /* texto secundario */
  --bg:           #ffffff;   /* fondo de tarjetas */
  --page:         #f4f7fb;   /* fondo de página */
  --line:         #e3e8ef;   /* bordes y separadores */

  --danger:       #c0392b;
  --danger-bg:    #fdecea;
  --ok:           #1e8e3e;
  --ok-bg:        #e8f5e9;
  --info:         #2c6aa3;
  --info-bg:      #eaf2fb;

  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 10px 30px rgba(27, 60, 99, .10);
  --shadow-sm:    0 2px 8px rgba(0, 0, 0, .06);

  --font:         system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- Reset --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }

a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}
a:hover { color: var(--brand-dark); text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ---- Botones ------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  line-height: 1;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, opacity .15s;
  text-decoration: none;
}
.btn:disabled, .btn.is-busy { opacity: .7; cursor: default; }

.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); color: #fff; }

.btn-ghost {
  background: #fff;
  color: var(--brand);
  border-color: var(--line);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-light); }

.btn-block { width: 100%; }

/* ---- Formularios --------------------------------------------------- */
.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.field .hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}

.field input,
.field select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(56, 130, 198, .15);
}
.field input.has-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, .12);
}
.field input::placeholder { color: #aab2bd; }

.field-error {
  display: block;
  color: var(--danger);
  font-size: 12.5px;
  margin-top: 5px;
  min-height: 1em;
}

/* Campo con botón "mostrar/ocultar" */
.field-pass { position: relative; }
.field-pass input { padding-right: 70px; }
.field-pass .toggle-pass {
  position: absolute;
  right: 8px;
  top: 33px;
  border: none;
  background: none;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
}

/* Campo en mayúsculas (RFC) */
.uppercase { text-transform: uppercase; }

/* ---- Mensajes ------------------------------------------------------ */
.msg {
  display: none;
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.msg.is-visible { display: block; }
.msg-error { background: var(--danger-bg); color: var(--danger); border-color: #f5c6c0; }
.msg-ok    { background: var(--ok-bg);     color: var(--ok);     border-color: #b7e1c0; }
.msg-info  { background: var(--info-bg);   color: var(--info);   border-color: #bcd6f0; }

/* ---- Spinner ------------------------------------------------------- */
.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, .5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: fmx-spin .6s linear infinite;
  vertical-align: -2px;
}
.spinner-brand { border-color: rgba(56,130,198,.3); border-top-color: var(--brand); }
@keyframes fmx-spin { to { transform: rotate(360deg); } }

/* ---- Utilidades ---------------------------------------------------- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.mt-0 { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
