/* =============================================================================
   induccion.css — Estilos del módulo público (Landing + Portal de Inducción)
   Terminal Puerto Coquimbo
   ============================================================================= */

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --c-blue:         #003087;
  --c-blue-mid:     #0041b5;
  --c-blue-light:   #e8eef8;
  --c-blue-border:  #c8d8f0;
  --c-green:        #16a34a;
  --c-green-dark:   #166534;
  --c-green-light:  #dcfce7;
  --c-red:          #dc2626;
  --c-red-light:    #fee2e2;
  --c-orange:       #ea580c;
  --c-orange-light: #fff7ed;
  --c-bg:           #f1f5f9;
  --c-white:        #ffffff;
  --c-text:         #1a1a2e;
  --c-muted:        #64748b;
  --c-subtle:       #94a3b8;
  --c-border:       #e2e8f0;

  --radius:    8px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow:    0 4px 16px rgba(0,48,135,.10);
  --shadow-lg: 0 12px 40px rgba(0,48,135,.18);

  --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.5;
  min-height: 100vh;
}
button { font-family: var(--font); }
a { text-decoration: none; }

/* ── Animaciones ────────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }

.fade-up { animation: fadeUp .3s ease both; }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* LAYOUT PÚBLICO (header + main)                                              */
/* ═══════════════════════════════════════════════════════════════════════════ */

.tpc-pub-header {
  background: linear-gradient(135deg, #002070 0%, #003087 60%, #0041b5 100%);
  color: var(--c-white);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 0 3px 12px rgba(0,0,0,.28);
  position: sticky;
  top: 0;
  z-index: 100;
}
.tpc-pub-logo  { height: 44px; object-fit: contain; filter: drop-shadow(0 1px 3px rgba(0,0,0,.25)); }
.tpc-pub-brand { font-size: 17px; font-weight: 800; letter-spacing: -.2px; }
.tpc-pub-sub   { font-size: 12px; opacity: .72; margin-top: 2px; }

.tpc-pub-home-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.8);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.1);
  transition: all .18s;
}
.tpc-pub-home-link:hover {
  background: rgba(255,255,255,.2);
  color: var(--c-white);
}

.tpc-pub-main {
  max-width: 740px;
  margin: 40px auto 60px;
  padding: 0 18px;
}

@media (max-width: 520px) {
  .tpc-pub-header { padding: 10px 16px; gap: 12px; }
  .tpc-pub-logo   { height: 36px; }
  .tpc-pub-brand  { font-size: 14px; }
  .tpc-pub-home-link span { display: none; }
  .tpc-pub-main   { margin: 20px auto 40px; }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* LANDING PAGE                                                                */
/* ═══════════════════════════════════════════════════════════════════════════ */

.tpc-landing { max-width: 860px; margin: 0 auto; }

.tpc-landing-hero {
  text-align: center;
  padding: 52px 20px 36px;
}
.tpc-landing-logo {
  height: 72px;
  object-fit: contain;
  margin-bottom: 20px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 520px) {
  .tpc-landing-logo { height: 52px; margin-bottom: 14px; }
}
.tpc-landing-hero-badge {
  display: inline-block;
  background: var(--c-blue-light);
  color: var(--c-blue);
  border: 1px solid var(--c-blue-border);
  border-radius: 99px;
  padding: 5px 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.tpc-landing-title {
  font-size: 34px;
  font-weight: 900;
  color: var(--c-blue);
  margin-bottom: 10px;
  letter-spacing: -.5px;
  line-height: 1.15;
}
.tpc-landing-sub {
  font-size: 17px;
  color: var(--c-muted);
  margin-bottom: 0;
}

@media (max-width: 520px) {
  .tpc-landing-hero   { padding: 32px 16px 28px; }
  .tpc-landing-title  { font-size: 26px; }
  .tpc-landing-sub    { font-size: 15px; }
}

/* ── Módulos ─────────────────────────────────────────────────────────────── */
.tpc-modules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 0 0 16px;
}
@media (max-width: 640px) {
  .tpc-modules { grid-template-columns: 1fr; }
}

.tpc-module-card {
  background: var(--c-white);
  border-radius: var(--radius-xl);
  padding: 44px 36px 40px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 180px;
  gap: 18px;
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  color: var(--c-text);
  cursor: pointer;
  text-decoration: none;
}
.tpc-module-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .2s;
}
.tpc-module-card:hover .tpc-module-icon { transform: scale(1.1); }
.tpc-module-card--induccion .tpc-module-icon { background: var(--c-green-light); color: var(--c-green-dark); }
.tpc-module-card--acceso    .tpc-module-icon { background: var(--c-blue-light);  color: var(--c-blue); }
.tpc-module-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.tpc-module-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
}
.tpc-module-card--induccion::before { background: linear-gradient(90deg, #16a34a, #22c55e); }
.tpc-module-card--acceso::before    { background: linear-gradient(90deg, #003087, #0041b5); }

.tpc-module-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.tpc-module-card--induccion .tpc-module-icon {
  background: var(--c-green-light);
  color: var(--c-green-dark);
}
.tpc-module-card--acceso .tpc-module-icon {
  background: var(--c-blue-light);
  color: var(--c-blue);
}

.tpc-module-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 8px;
}
.tpc-module-card--induccion .tpc-module-tag { color: var(--c-green-dark); }
.tpc-module-card--acceso    .tpc-module-tag { color: var(--c-blue); }

.tpc-module-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--c-text);
  margin: 0;
  letter-spacing: -.3px;
}
.tpc-module-card--induccion .tpc-module-title { color: var(--c-green-dark); }
.tpc-module-card--acceso    .tpc-module-title { color: var(--c-blue); }

.tpc-module-desc {
  font-size: 14px;
  color: var(--c-muted);
  line-height: 1.65;
  margin-bottom: 20px;
  flex: 1;
}

.tpc-module-features {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}
.tpc-module-features span {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.tpc-module-arrow {
  position: absolute;
  bottom: 28px;
  right: 28px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .18s;
}
.tpc-module-card--induccion .tpc-module-arrow { background: var(--c-green-light); color: var(--c-green-dark); }
.tpc-module-card--acceso    .tpc-module-arrow { background: var(--c-blue-light);  color: var(--c-blue); }
.tpc-module-card:hover .tpc-module-arrow { transform: translateX(4px); }

.tpc-module-content { padding-right: 20px; }

.tpc-landing-footer {
  text-align: center;
  font-size: 12px;
  color: var(--c-subtle);
  padding: 28px 0 12px;
}

@media (max-width: 480px) {
  .tpc-module-card  { padding: 28px 22px; }
  .tpc-module-title { font-size: 19px; }
  .tpc-module-arrow { bottom: 22px; right: 22px; }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* WIZARD DE INDUCCIÓN (reutiliza el mismo sistema de diseño)                  */
/* ═══════════════════════════════════════════════════════════════════════════ */

.tpc-card {
  background: var(--c-white);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.tpc-card--aprobado { border-top: 5px solid var(--c-green); }
.tpc-card--reprobado{ border-top: 5px solid var(--c-red); }
.tpc-card--vigente  { border-top: 5px solid var(--c-green); }
@media (max-width: 520px) { .tpc-card { padding: 22px 16px; border-radius: var(--radius); } }

.tpc-input {
  width: 100%; padding: 12px 16px; font-size: 15px; font-family: var(--font);
  border: 2px solid var(--c-border); border-radius: var(--radius); outline: none;
  background: var(--c-white); color: var(--c-text);
  transition: border-color .18s, box-shadow .18s;
}
.tpc-input:focus          { border-color: var(--c-blue); box-shadow: 0 0 0 3px rgba(0,48,135,.12); }
.tpc-input.has-value      { border-color: var(--c-blue-mid); }
.tpc-input[readonly],
.tpc-input:read-only      { background: var(--c-bg); color: var(--c-muted); cursor: not-allowed; border-color: var(--c-border); }
.tpc-input--lg            { font-size: 20px; letter-spacing: 3px; text-transform: uppercase; padding: 16px 18px; text-align: center; }

.tpc-label { display: block; font-weight: 600; font-size: 13px; color: #374151; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .4px; }
.tpc-label span.req { color: var(--c-red); }
.tpc-hint  { font-size: 12px; color: var(--c-subtle); margin-top: 5px; display: flex; align-items: center; gap: 4px; }

.tpc-btn {
  min-height: 50px; padding: 13px 32px; border-radius: var(--radius);
  font-size: 15px; font-weight: 700; font-family: var(--font);
  cursor: pointer; border: none;
  transition: all .18s; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  text-decoration: none; letter-spacing: .1px;
}
.tpc-btn:hover:not(:disabled)  { opacity: .88; transform: translateY(-1px); }
.tpc-btn:active:not(:disabled) { transform: scale(.97); }
.tpc-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.tpc-btn-primary { background: var(--c-blue);  color: var(--c-white); box-shadow: 0 4px 14px rgba(0,48,135,.25); }
.tpc-btn-outline { background: var(--c-white); color: var(--c-blue);  border: 2px solid var(--c-blue); }
.tpc-btn-success { background: var(--c-green); color: var(--c-white); box-shadow: 0 4px 14px rgba(22,163,74,.25); }
.tpc-btn-danger  { background: var(--c-red);   color: var(--c-white); }
.tpc-btn-gray    { background: var(--c-white); color: #555;           border: 2px solid var(--c-border); }
.tpc-btn-full    { width: 100%; }
.tpc-btn-row     { margin-top: 28px; display: flex; justify-content: flex-end; }
.tpc-action-row  { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 480px) {
  .tpc-btn { font-size: 14px; padding: 12px 20px; }
  .tpc-action-row { flex-direction: column; align-items: stretch; }
  .tpc-action-row button, .tpc-action-row a { width: 100%; }
  .tpc-btn-row { justify-content: center; }
  .tpc-btn-row button { width: 100%; }
}

.tpc-alert { padding: 13px 16px; border-radius: var(--radius); font-size: 14px; display: flex; align-items: flex-start; gap: 9px; margin-top: 16px; line-height: 1.5; }
.tpc-alert--error { background: #fff0f0; border: 1px solid #ffc5c5; color: #b91c1c; }
.tpc-alert--info  { background: var(--c-blue-light); border: 1px solid var(--c-blue-border); color: var(--c-blue); }

.tpc-page-title { font-size: 28px; font-weight: 800; color: var(--c-blue); margin-bottom: 8px; letter-spacing: -.3px; }
.tpc-page-sub   { font-size: 15px; color: var(--c-muted); margin-bottom: 32px; line-height: 1.65; }
.tpc-hero-icon  { display: block; margin: 0 auto 18px; }

.tpc-step-header { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; padding-bottom: 18px; border-bottom: 2px solid var(--c-bg); flex-wrap: wrap; }
.tpc-step-badge  { background: var(--c-blue); color: var(--c-white); border-radius: var(--radius); padding: 4px 13px; font-size: 12px; font-weight: 700; letter-spacing: .5px; }
.tpc-step-title  { font-weight: 700; font-size: 16px; color: var(--c-blue); }

.tpc-form-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 580px) { .tpc-form-grid { grid-template-columns: 1fr; } }

.tpc-historial-card { background: var(--c-white); border-radius: var(--radius-lg); padding: 22px 28px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.tpc-historial-card--aprobado  { border-left: 5px solid var(--c-green); }
.tpc-historial-card--reprobado { border-left: 5px solid var(--c-orange); }
.tpc-historial-title { font-weight: 700; color: var(--c-blue); margin-bottom: 14px; font-size: 14px; text-transform: uppercase; letter-spacing: .5px; }

.tpc-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 480px) { .tpc-stats-grid { grid-template-columns: 1fr 1fr; } }

.tpc-info-label       { font-size: 11px; color: #777; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .5px; }
.tpc-info-value       { font-weight: 700; font-size: 15px; }
.tpc-info-value--green{ color: var(--c-green-dark); }
.tpc-info-value--blue { color: var(--c-blue); }
.tpc-info-value--muted{ font-weight: 600; font-size: 14px; color: #333; }

.tpc-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; animation: fadeUp .2s ease; backdrop-filter: blur(3px);
}
.tpc-modal-inner { background: var(--c-white); border-radius: var(--radius-xl); padding: 40px 32px; max-width: 460px; width: 93%; box-shadow: var(--shadow-lg); text-align: center; }
.tpc-modal-title { font-size: 22px; font-weight: 800; color: var(--c-blue); margin-bottom: 14px; }
.tpc-modal-body  { color: var(--c-muted); font-size: 14px; line-height: 1.7; margin-bottom: 12px; }
.tpc-modal-data  { background: var(--c-blue-light); border: 1px solid var(--c-blue-border); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 28px; text-align: left; font-size: 14px; color: #334; line-height: 1.9; }
@media (max-width: 480px) { .tpc-modal-inner { padding: 26px 18px; } }

.tpc-progress-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; gap: 8px; }
.tpc-progress-name  { font-weight: 800; color: var(--c-blue); font-size: 14px; text-transform: uppercase; letter-spacing: .4px; }
.tpc-progress-sub   { font-size: 13px; color: var(--c-muted); margin-top: 3px; }
.tpc-progress-count { font-weight: 800; font-size: 20px; flex-shrink: 0; }
.tpc-progress-count--done    { color: var(--c-green); }
.tpc-progress-count--pending { color: var(--c-blue); }
.tpc-progress-track { background: #e2e8f0; border-radius: 99px; height: 9px; overflow: hidden; }
.tpc-progress-fill  { height: 9px; border-radius: 99px; transition: width .35s ease; }
.tpc-progress-fill--done    { background: var(--c-green); }
.tpc-progress-fill--pending { background: var(--c-blue); }

.tpc-banner { background: var(--c-blue); color: var(--c-white); padding: 14px 28px; display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; border-radius: var(--radius) var(--radius) 0 0; }

.tpc-question { background: var(--c-white); padding: 26px 30px; margin-bottom: 3px; box-shadow: 0 1px 4px rgba(0,0,0,.05); transition: border-left-color .18s; }
.tpc-question--answered { border-left: 5px solid var(--c-blue); }
.tpc-question--pending  { border-left: 5px solid var(--c-border); }
@media (max-width: 480px) { .tpc-question { padding: 16px 14px; } }

.tpc-question-num { display: inline-flex; align-items: center; justify-content: center; background: var(--c-blue); color: var(--c-white); border-radius: 50%; width: 28px; height: 28px; font-size: 13px; font-weight: 700; flex-shrink: 0; margin-right: 10px; }
.tpc-question-text { font-weight: 600; color: #1e293b; margin-bottom: 16px; line-height: 1.55; display: flex; align-items: flex-start; font-size: 15px; }
.tpc-answers { display: flex; flex-direction: column; gap: 8px; }

.tpc-answer-btn { padding: 12px 16px; text-align: left; cursor: pointer; border: 2px solid var(--c-border); border-radius: var(--radius); background: var(--c-white); color: #374151; font-size: 14px; font-weight: 400; font-family: var(--font); transition: all .15s; display: flex; align-items: center; gap: 12px; min-height: 50px; width: 100%; line-height: 1.45; }
.tpc-answer-btn:hover:not(.tpc-answer-btn--selected) { border-color: var(--c-blue-mid); background: var(--c-blue-light); }
.tpc-answer-btn--selected { border-color: var(--c-blue); background: var(--c-blue-light); color: var(--c-blue); font-weight: 600; }
.tpc-answer-letter { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; border: 2px solid var(--c-border); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #9ca3af; transition: all .15s; text-transform: uppercase; }
.tpc-answer-btn--selected .tpc-answer-letter { border-color: var(--c-blue); background: var(--c-blue); color: var(--c-white); }

.tpc-submit-footer { background: var(--c-white); padding: 30px; box-shadow: var(--shadow-sm); border-radius: 0 0 var(--radius-lg) var(--radius-lg); text-align: center; margin-bottom: 40px; }

.tpc-result-badge { display: inline-block; padding: 9px 28px; border-radius: 99px; font-weight: 800; font-size: 18px; margin-bottom: 20px; letter-spacing: .5px; }
.tpc-result-badge--green { background: var(--c-green-light); color: var(--c-green-dark); }
.tpc-result-badge--red   { background: var(--c-red-light);   color: var(--c-red); }

.tpc-score-row    { display: flex; justify-content: center; align-items: center; gap: 48px; margin: 24px 0 28px; }
.tpc-score-num    { font-size: 56px; font-weight: 900; line-height: 1; }
.tpc-score-label  { font-size: 12px; color: #64748b; margin-top: 5px; text-transform: uppercase; letter-spacing: .4px; }
.tpc-score-divider{ width: 1px; height: 64px; background: #e2e8f0; flex-shrink: 0; }
.tpc-score-num--green { color: var(--c-green); }
.tpc-score-num--red   { color: var(--c-red); }
.tpc-score-num--blue  { color: var(--c-blue); }
@media (max-width: 480px) { .tpc-score-row { gap: 24px; } .tpc-score-num { font-size: 42px; } }

.tpc-cert-box  { background: #f0fdf4; border: 2px dashed var(--c-green); border-radius: 12px; padding: 20px 28px; margin-bottom: 28px; }
.tpc-cert-label{ font-size: 12px; color: var(--c-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.tpc-cert-code { font-family: 'Courier New', monospace; font-size: 17px; font-weight: 700; color: var(--c-blue); letter-spacing: 1px; }
.tpc-cert-exp  { font-size: 13px; color: var(--c-green-dark); margin-top: 10px; display: flex; align-items: center; gap: 6px; font-weight: 600; }

.tpc-detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; }
.tpc-detail-item { padding: 12px 8px; border-radius: var(--radius); text-align: center; }
.tpc-detail-item--correct { background: var(--c-green-light); border: 1px solid #86efac; }
.tpc-detail-item--wrong   { background: var(--c-red-light);   border: 1px solid #fca5a5; }
.tpc-detail-item__id  { font-weight: 700; color: #1e293b; font-size: 14px; margin-bottom: 4px; }
.tpc-detail-item__pts { font-size: 12px; color: var(--c-muted); }

.tpc-info-box { background: #f0fdf4; border: 1px solid #86efac; border-radius: var(--radius-lg); padding: 24px 28px; margin-bottom: 28px; text-align: left; }

.tpc-countdown { margin-top: 20px; padding: 14px 20px; border-radius: var(--radius); text-align: center; font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; }
.tpc-countdown--ok     { background: var(--c-green-light); color: var(--c-green-dark); }
.tpc-countdown--warn   { background: var(--c-orange-light); color: var(--c-orange); }
.tpc-countdown--danger { background: var(--c-red-light);   color: var(--c-red); }

.tpc-loading-track { background: var(--c-bg); border-radius: 99px; height: 8px; overflow: hidden; max-width: 320px; margin: 16px auto 0; }
.tpc-loading-fill  { height: 8px; border-radius: 99px; background: var(--c-blue); transition: width 1.8s ease; }
.tpc-spinner { width: 52px; height: 52px; border: 5px solid var(--c-blue-light); border-top-color: var(--c-blue); border-radius: 50%; animation: spin .9s linear infinite; margin: 0 auto 20px; }

.text-center { text-align: center; }
.text-muted  { color: var(--c-muted); }
