/* ══════════════════════════════════════════
   BASE.CSS
   ══════════════════════════════════════════ */

/* ── TOKENS ── */
:root {
  --accent:       #00897B;
  --accent-light: #E0F2F1; 
  --accent-mid:   #26A69A;
  --accent-dim:   rgba(0,137,123,.18);
  --rule:         rgba(0,137,123,.4);

  --blue:         #1565C0;
  --blue-light:   #E3F0FF;
  --warning:      #F59E0B;
  --warning-light:#FEF3C7;
  --danger:       #EF4444;
  --danger-light: #FEE2E2;

  --bg:           #F3F4F6;
  --bg-subtle:    #F8FAFC;
  --surface:      #FFFFFF;
  --border:       #E5E7EB;
  --border-focus: #00897B;

  --text:         #111827;
  --text-primary: #111827;
  --text-mid:     #4B5563;
  --text-sub:     #9CA3AF;

  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    16px;

  --shadow-sm:    0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:    0 4px 12px rgba(0,0,0,.08);

  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── BASE ── */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

body.splash {
  overflow: hidden;
  height: 100%;
}

/* ── HEADER ── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  color: var(--text-mid);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
  flex-shrink: 0;
}
.btn-back:hover { background: var(--bg); }

.header-titles {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.header-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.header-sub {
  font-size: 11px;
  color: var(--text-sub);
}

.badge-mode {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid rgba(0,137,123,.25);
  border-radius: 20px;
  padding: 4px 10px;
  flex-shrink: 0;
}

/* ── TOGGLE DE VISTA ── */
.vista-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  flex-shrink: 0;
}
.vista-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
  text-decoration: none;
  transition: background .15s, color .15s;
  font-family: var(--font);
}
.vista-btn:hover { background: var(--surface); color: var(--text); }
.vista-btn--active { background: var(--accent); color: #fff; }
.vista-btn--active:hover { background: var(--accent-mid); color: #fff; }

/* ── FORM CONTAINER ── */
.form-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 0px 16px 0px 16px;
  display: flex;
  flex-direction: column;
  gap: 0px; 
}

/* ── CARD BASE ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .2s;
  margin-bottom: 14px;  
}

.card--sticky-inner {
  overflow: visible;
}
.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
}
.card-header--blue { color: var(--blue); }
.card-header--blue .card-icon { color: var(--blue); }
.card-icon { color: var(--accent); flex-shrink: 0; }

.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── FIELDS ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
}

.req { color: var(--danger); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  appearance: none;
  -webkit-appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--text-sub); }

input:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0,137,123,.12);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

textarea { resize: vertical; min-height: 80px; line-height: 1.6; }

input.invalid, select.invalid, textarea.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239,68,68,.10);
}

.field-error {
  font-size: 11px;
  color: var(--danger);
  display: none;
}
.field-error.visible { display: block; }

/* ── INPUT CON ÍCONO ── */
.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon-wrap > svg {
  position: absolute;
  left: 12px;
  color: var(--text-sub);
  pointer-events: none;
  flex-shrink: 0;
  transition: color .18s;
}
.input-icon-wrap:focus-within svg { color: var(--accent); }
.input-icon-wrap input {
  padding-left: 38px;
  padding-right: 14px;
}

/* ── BÚSQUEDA CON ÍCONO ── */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-wrap svg {
  position: absolute;
  left: 12px;
  pointer-events: none;
}
.search-wrap input { padding-left: 36px; }

/* ── BOTONES ── */
.btn-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font);
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(0,137,123,.25);
}
.btn-primary:hover {
  background: var(--accent-mid);
  box-shadow: 0 4px 12px rgba(0,137,123,.35);
}
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.btn-outline {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  color: var(--accent);
  background: transparent;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.btn-outline:hover { background: var(--accent-light); }

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

/* ── SPINNER EN BOTÓN ── */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.btn-primary.loading .btn-spinner { display: block; }
.btn-primary.loading .btn-label  { display: none; }

/* ── TABS ACREDITACIÓN ── */
.tabs-acreditacion {
  display: flex;
  gap: 21px;
  flex-wrap: wrap;
}



.tab-btn {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-mid);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;

}
.tab-btn:hover { 
  border-color: var(--accent);
  scale: 1.1;
  font-weight: bold;
}
.tab-btn--active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── NAV LOGIN ── */
.nav-login {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  text-decoration: none;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color .15s, color .15s;
}
.nav-login:hover { border-color: var(--accent); color: var(--accent); }

/* ── HEADER DE PANEL (compartido por panel_lab.html, requerimiento.html,
   cotizacion.html y preparar_cotizacion.html) — antes duplicado igual en
   cada uno de esos CSS; se consolidó aquí para editar una sola vez. ── */
.panel-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.panel-header-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-light);
  border: 1px solid rgba(0,137,123,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.panel-header-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.panel-header-logo svg {
  color: var(--accent);
}



.panel-header-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}

.panel-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.panel-usuario-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.btn-header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-mid);
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  flex-shrink: 0;
}
.btn-header-nav:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.panel-usuario-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.panel-usuario-nombre {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.panel-usuario-rol {
  font-size: 10px;
  color: var(--text-sub);
}

/* ── TOAST (global — cualquier página puede usarlo sin depender
   de requerimiento.css. Fondo fijo oscuro y texto blanco fijo,
   a propósito NO ligados a --text/--surface, para que el
   contraste se mantenga igual en modo claro y en modo oscuro) ── */
.toast-msg {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #111827;
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
  opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  white-space: nowrap;
  z-index: 9999;
}
.toast-msg.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── UTILITY ── */
.hidden { display: none !important; }

/* ── KEYFRAMES ── */
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  to { opacity: 1; }
}
@keyframes arcDraw {
  to { stroke-dashoffset: 0; }
}
@keyframes spinLoop {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
  .field-row      { grid-template-columns: 1fr; }
  .form-container { padding: 10px 10px 48px; }
  .app-header     { padding: 12px 14px; }

}

/* ── MODO OSCURO ── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:           #080c18;
    --bg-subtle:    #0d1120;
    --surface:      #0f1623;
    --border:       rgba(79,195,247,.18);
    --border-focus: #4fc3f7;

    --text:         #e8f4ff;
    --text-primary: #e8f4ff;
    --text-mid:     rgba(200,225,255,.7);
    --text-sub:     rgba(200,225,255,.35);

    --accent:       #4fc3f7;
    --accent-light: rgba(79,195,247,.12);
    --accent-mid:   #81d4fa;
    --accent-dim:   rgba(79,195,247,.18);
    --rule:         rgba(79,195,247,.35);

    --blue-light:   rgba(21,101,192,.18);
    --warning-light:rgba(245,158,11,.15);
    --danger:       #f87171;
    --danger-light: rgba(248,113,113,.12);

    --shadow-sm:    0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
    --shadow-md:    0 4px 20px rgba(0,0,0,.5);
  }

  .btn-primary {
    color: #080c18;
    font-weight: 800;
    box-shadow: 0 2px 12px rgba(79,195,247,.3);
  }
  .btn-primary:hover {
    box-shadow: 0 4px 20px rgba(79,195,247,.45);
  }

  .btn-spinner {
    border-color: rgba(8,12,24,.3);
    border-top-color: #080c18;
  }
}

/* ══════════════════════════════════════════
   SPLASH (index.html)
   ══════════════════════════════════════════ */

#particles-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.splash-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: 0;
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.4s forwards;
}

.logo-wordmark {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1;
  user-select: none;
}

.logo-prefix { color: var(--text-primary); }
.logo-accent { color: var(--accent); }
.logo-suffix { color: var(--text-primary); }

.logo-rule {
  width: 64px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 2px;
}

.loader-block {
  margin-top: 48px;
  opacity: 0;
  animation: fadeIn 0.7s ease 1.3s forwards;
}

.spinner {
  width: 36px;
  height: 36px;
  overflow: visible;
}

.spinner-track {
  fill: none;
  stroke: var(--accent-dim);
  stroke-width: 2.5;
}

.spinner-arc {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 56;
  stroke-dashoffset: 56;
  transform-origin: center;
  animation:
    arcDraw  0.9s cubic-bezier(0.4, 0, 0.2, 1) 1.5s forwards,
    spinLoop 1.4s linear 2.4s infinite;
}

.splash-footer {
  position: fixed;
  bottom: 36px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0;
  animation: fadeIn 0.9s ease 1.6s forwards;
}

.tagline {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.72rem, 2vw, 0.85rem);
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-sub);
}

.standard {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--rule);
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  .brand-block,
  .loader-block,
  .splash-footer {
    animation: fadeIn 0.4s ease forwards;
    transform: none;
  }
  .spinner-arc {
    animation: spinLoop 2s linear infinite;
    stroke-dashoffset: 0;
  }
}