/* =====================================================
   STATUS LEGAL SOLUTIONS — app.css
   Estilos para: páginas de autenticación, dashboards
   (cliente y admin), tabla de clientes, tarjetas de
   abogados y línea de tiempo del caso.
   Reutiliza las variables de diseño definidas en styles.css
   ===================================================== */

.btn-sm { padding: 9px 18px; font-size: .82rem; }
.btn-danger { border-color: #C0392B; color: #C0392B; }
.btn-danger:hover { background: #C0392B; color: var(--white); border-color: #C0392B; }

/* ===========================
   ALERTAS
   =========================== */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-size: .92rem;
  line-height: 1.5;
}
.alert ul { padding-left: 20px; margin: 0; }
.alert-error {
  background: #FCEAEA;
  border: 1px solid #E9B4B0;
  color: #A5312A;
}
.alert-success {
  background: #E9F5EE;
  border: 1px solid #A9D9BE;
  color: #1F6B45;
}

/* ===========================
   PÁGINA PÚBLICA — ABOGADOS
   =========================== */
.page-header {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%);
  padding: calc(var(--nav-height) + 70px) 24px 70px;
  text-align: center;
  color: var(--white);
}
.page-header .section-label { color: var(--gold-light); }
.page-header .section-title { color: var(--white); }
.page-header .section-subtitle { color: rgba(255,255,255,.75); max-width: 640px; margin: 16px auto 0; }

.abogados-section { padding: 80px 24px; background: var(--off-white); }
.abogados-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  max-width: 1100px;
  margin: 0 auto;
}
.abogado-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 36px 28px;
  text-align: center;
  transition: var(--transition);
}
.abogado-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.abogado-card h3 { font-family: var(--font-display); color: var(--navy); font-size: 1.3rem; margin-bottom: 10px; }
.abogado-card p { color: var(--text-body); font-size: .92rem; line-height: 1.6; margin-bottom: 22px; min-height: 66px; }

.abogado-foto {
  width: 120px; height: 120px;
  margin: 0 auto 20px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--gold-light);
  box-shadow: var(--shadow-sm);
}
.abogado-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.abogado-foto-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-light);
  color: var(--gray-mid);
  font-size: 2.2rem;
}
.abogado-foto--sm { width: 72px; height: 72px; margin-bottom: 14px; }

.empty-state {
  text-align: center;
  color: var(--gray-mid);
  padding: 30px 10px;
  font-size: .95rem;
}

/* ===========================
   PÁGINAS DE AUTENTICACIÓN
   =========================== */
.auth-body {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-wrapper { width: 100%; max-width: 440px; }
.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 44px 40px;
}
.auth-logo { display: block; text-align: center; margin-bottom: 28px; }
.auth-card h1 {
  font-family: var(--font-display);
  color: var(--navy);
  font-size: 1.7rem;
  text-align: center;
  margin-bottom: 6px;
}
.auth-subtitle { text-align: center; color: var(--text-body); font-size: .9rem; margin-bottom: 28px; }

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}
.form-group small { display: block; color: var(--gray-mid); font-size: .78rem; margin-top: 6px; line-height: 1.4; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .95rem;
  color: var(--text-main);
  background: var(--off-white);
  transition: var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--white);
}
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.auth-form .btn { margin-top: 6px; }
.auth-switch { text-align: center; margin-top: 22px; font-size: .9rem; color: var(--text-body); }
.auth-switch a { color: var(--gold-dark); font-weight: 700; }
.auth-back {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 16px; color: rgba(255,255,255,.7); font-size: .85rem;
}

/* ===========================
   TOPBAR (dashboard cliente + admin)
   =========================== */
.app-topbar {
  background: var(--navy);
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 500;
}
.app-topbar-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.app-topbar .logo-main { color: var(--white); }
.app-topbar .logo-sub { color: var(--gold-light); }

.app-topnav { display: flex; gap: 6px; flex-wrap: wrap; }
.app-topnav-link {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.75);
  font-size: .88rem; font-weight: 600;
  transition: var(--transition);
}
.app-topnav-link:hover { background: rgba(255,255,255,.08); color: var(--white); }
.app-topnav-link.active { background: var(--gold); color: var(--navy-dark); }

.app-topbar-user { display: flex; align-items: center; gap: 16px; }
.app-topbar-username { color: var(--white); font-size: .88rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.app-topbar-link { color: rgba(255,255,255,.65); font-size: .82rem; display: flex; align-items: center; gap: 6px; }
.app-topbar-user .btn-outline-navy {
  background: transparent; border-color: rgba(255,255,255,.3); color: var(--white);
}
.app-topbar-user .btn-outline-navy:hover { background: var(--gold); border-color: var(--gold); color: var(--navy-dark); }

/* ===========================
   ÁREA GENERAL DE DASHBOARD
   =========================== */
.app-main { background: var(--off-white); min-height: calc(100vh - 70px); padding: 40px 24px 80px; }
.app-hero { max-width: 1280px; margin: 0 auto 28px; }
.app-hero h1 { font-family: var(--font-display); color: var(--navy); font-size: 1.9rem; margin-bottom: 6px; }
.app-hero p { color: var(--text-body); }
.app-back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--gold-dark); font-weight: 700; font-size: .85rem; margin-bottom: 10px; }

.dash-grid {
  max-width: 1280px; margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}
.dash-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}
.dash-card--wide { grid-column: 1 / -1; }
.dash-card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.dash-card-header h2 {
  font-family: var(--font-display); color: var(--navy); font-size: 1.25rem;
  display: flex; align-items: center; gap: 10px;
}
.dash-card-header h2 i { color: var(--gold); }

.progress-pill {
  background: var(--gray-light);
  color: var(--navy);
  font-size: .8rem; font-weight: 700;
  padding: 6px 14px;
  border-radius: 100px;
}
.progress-bar-track {
  background: var(--gray-light);
  border-radius: 100px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 30px;
}
.progress-bar-fill {
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
  height: 100%;
  border-radius: 100px;
  transition: width .6s ease;
}

/* ---- Línea de tiempo del cliente ---- */
.client-timeline { display: flex; flex-direction: column; }
.ct-step { display: flex; gap: 18px; position: relative; }
.ct-marker {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .95rem;
  background: var(--gray-light); color: var(--gray-mid);
  border: 2px solid var(--gray-light);
  z-index: 1;
}
.ct-step--en_proceso .ct-marker { background: var(--gold); color: var(--white); border-color: var(--gold); }
.ct-step--completado .ct-marker { background: #2E9E5B; color: var(--white); border-color: #2E9E5B; }
.ct-line { position: absolute; left: 19px; top: 40px; bottom: -8px; width: 2px; background: var(--gray-light); }
.ct-step--completado .ct-line { background: #2E9E5B; }
.ct-content { padding-bottom: 30px; flex: 1; padding-top: 6px; }
.ct-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ct-top h3 { font-size: 1.02rem; color: var(--navy); font-family: var(--font-body); font-weight: 700; }
.ct-fecha { font-size: .8rem; color: var(--gray-mid); margin-top: 4px; }
.ct-nota { font-size: .88rem; color: var(--text-body); margin-top: 8px; background: var(--off-white); padding: 10px 14px; border-radius: var(--radius-sm); line-height: 1.5; }

.status-badge {
  font-size: .72rem; font-weight: 700; letter-spacing: .03em;
  padding: 5px 12px; border-radius: 100px; text-transform: uppercase; white-space: nowrap;
}
.status-badge--pendiente { background: var(--gray-light); color: var(--gray-dark); }
.status-badge--en_proceso { background: #FBF0DA; color: var(--gold-dark); }
.status-badge--completado { background: #E1F4E9; color: #1F6B45; }

.info-list { list-style: none; }
.info-list li { padding: 10px 0; border-bottom: 1px solid var(--gray-light); font-size: .9rem; color: var(--text-body); }
.info-list li:last-child { border-bottom: none; }
.info-list strong { color: var(--navy); }

.dash-abogado { text-align: center; }
.dash-abogado h3 { font-family: var(--font-display); color: var(--navy); margin-bottom: 8px; }
.dash-abogado p { color: var(--text-body); font-size: .88rem; margin-bottom: 18px; line-height: 1.5; }

/* ===========================
   ADMIN — tabla de clientes
   =========================== */
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin-table th {
  text-align: left; padding: 12px 14px; color: var(--gray-mid);
  font-size: .75rem; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 2px solid var(--gray-light);
}
.admin-table td { padding: 14px; border-bottom: 1px solid var(--gray-light); color: var(--text-body); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }

.mini-progress { display: flex; align-items: center; gap: 10px; min-width: 130px; }
.mini-progress-track { flex: 1; height: 7px; background: var(--gray-light); border-radius: 100px; overflow: hidden; }
.mini-progress-fill { height: 100%; background: var(--gold); border-radius: 100px; }
.mini-progress span { font-size: .78rem; color: var(--gray-mid); white-space: nowrap; }

/* ===========================
   ADMIN — formularios
   =========================== */
.admin-form-subtitle {
  font-family: var(--font-display); color: var(--navy); font-size: 1.1rem;
  margin: 26px 0 16px; padding-top: 18px; border-top: 1px solid var(--gray-light);
  display: flex; align-items: center; gap: 10px;
}
.admin-form-subtitle i { color: var(--gold); }

.admin-paso-editor {
  display: flex; gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--gray-light);
}
.admin-paso-editor:last-of-type { border-bottom: none; }
.admin-paso-num {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
}
.admin-paso-fields { flex: 1; }
.admin-paso-fields h3 { font-size: .98rem; color: var(--navy); margin-bottom: 12px; }

.admin-abogados-list { display: flex; flex-direction: column; gap: 16px; }
.admin-abogado-row {
  display: flex; align-items: center; gap: 18px;
  padding: 16px; background: var(--off-white); border-radius: var(--radius-md);
  flex-wrap: wrap;
}
.admin-abogado-info { flex: 1; min-width: 180px; }
.admin-abogado-info h3 { color: var(--navy); font-size: 1rem; margin-bottom: 4px; }
.admin-abogado-info p { color: var(--text-body); font-size: .85rem; line-height: 1.4; margin-bottom: 6px; }
.admin-abogado-wa { font-size: .8rem; color: var(--gray-mid); }
.admin-abogado-wa i { color: #25D366; margin-right: 4px; }

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .app-topnav { order: 3; width: 100%; justify-content: flex-start; }
}
@media (max-width: 520px) {
  .auth-card { padding: 32px 24px; }
  .app-topbar-user { gap: 10px; }
  .app-topbar-username { display: none; }
  .admin-abogado-row { flex-direction: column; align-items: flex-start; }
}
