/* =========================================================
   COPOSVAL, A.C. — Hoja de estilos principal
   Identidad: Guinda Institucional #710B22 / Gris Grafito #333333
   ========================================================= */

:root {
  --guinda: #710B22;
  --guinda-light: #9c1432;
  --guinda-dark: #4d0717;
  --guinda-soft: #f7e9ec;
  --grafito: #333333;
  --gris-texto: #4a4a4a;
  --gris-borde: #e3e1e4;
  --bg: #faf9fb;
  --white: #ffffff;
  --success: #1e7e34;
  --warning: #b8860b;
  --danger: #a52a2a;

  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', 'Segoe UI', Helvetica, Arial, sans-serif;

  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(30, 10, 15, .06);
  --shadow-md: 0 8px 24px rgba(30, 10, 15, .10);
  --shadow-lg: 0 20px 50px rgba(30, 10, 15, .16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--gris-texto);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--guinda); text-decoration: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--grafito);
  line-height: 1.25;
  margin: 0 0 .5em 0;
}

.section { padding: 80px 0; }
.section-alt { background: var(--white); }

.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--guinda);
  margin-bottom: 12px;
}

.section-head { max-width: 700px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { font-size: 2.1rem; }
.section-head p { color: var(--gris-texto); font-size: 1.05rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .2s ease;
}
.btn-primary { background: var(--guinda); color: var(--white); }
.btn-primary:hover { background: var(--guinda-dark); transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: var(--guinda); color: var(--guinda); }
.btn-outline:hover { background: var(--guinda); color: var(--white); }
.btn-light { background: var(--white); color: var(--guinda); }
.btn-light:hover { background: var(--guinda-soft); }
.btn-sm { padding: 8px 16px; font-size: .85rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Topbar ---------- */
.topbar { background: var(--grafito); color: #d8d5d6; font-size: .82rem; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; padding: 8px 24px; }
.topbar-contact span { margin-right: 20px; }
.topbar-links a { color: #d8d5d6; }
.topbar-links a:hover { color: var(--white); }

/* ---------- Header ---------- */
.site-header {
  background: var(--white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; gap: 24px; }
.brand-logo { height: 58px; width: auto; }
.main-nav { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.main-nav a { font-weight: 600; font-size: .95rem; color: var(--grafito); padding: 6px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a.active { color: var(--guinda); border-color: var(--guinda); }
.btn-nav-cta {
  background: var(--guinda); color: var(--white) !important; padding: 10px 20px;
  border-radius: 999px; border-bottom: none !important;
}
.btn-nav-cta:hover { background: var(--guinda-dark); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 26px; height: 3px; background: var(--grafito); border-radius: 2px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--guinda) 0%, var(--guinda-dark) 100%);
  color: var(--white);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 85% 20%, rgba(255,255,255,.08) 0, transparent 45%),
                     radial-gradient(circle at 10% 90%, rgba(255,255,255,.06) 0, transparent 40%);
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center;
  padding: 100px 24px 90px;
}
.hero h1 { color: var(--white); font-size: 2.9rem; margin-bottom: 18px; }
.hero p.lead { font-size: 1.15rem; color: rgba(255,255,255,.88); max-width: 560px; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-emblem { display: flex; justify-content: center; }
.hero-emblem .emblem-card {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 20px;
  padding: 40px;
  backdrop-filter: blur(6px);
}
.hero-emblem img { width: 260px; filter: brightness(0) invert(1); }

.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; background: var(--white); }
.hero-stats .stat { text-align: center; padding: 32px 16px; border-right: 1px solid var(--gris-borde); }
.hero-stats .stat:last-child { border-right: none; }
.hero-stats .stat strong { display: block; font-family: var(--font-serif); font-size: 2.1rem; color: var(--guinda); }
.hero-stats .stat span { font-size: .85rem; color: var(--gris-texto); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Cards ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--guinda);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card .icon {
  width: 52px; height: 52px; border-radius: 12px;
  background: var(--guinda-soft); color: var(--guinda);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: 18px;
}
.card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.card p { font-size: .95rem; color: var(--gris-texto); margin: 0; }

/* ---------- Valores / lista con check ---------- */
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { position: relative; padding: 10px 0 10px 34px; border-bottom: 1px solid var(--gris-borde); }
.check-list li:last-child { border-bottom: none; }
.check-list li::before {
  content: "✓"; position: absolute; left: 0; top: 10px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--guinda); color: var(--white);
  font-size: .75rem; display: flex; align-items: center; justify-content: center;
}

/* ---------- Nosotros: misión/visión ---------- */
.mv-card { background: var(--white); border-radius: var(--radius); padding: 36px; box-shadow: var(--shadow-sm); }
.mv-card h3 { color: var(--guinda); }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--grafito); color: var(--white);
  padding: 64px 0; text-align: center;
}
.cta-band h2 { color: var(--white); }
.cta-band p { color: #cfcfcf; max-width: 600px; margin: 0 auto 28px; }

/* ---------- Directorio ---------- */
.directorio-toolbar {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  display: grid;
  grid-template-columns: 2fr 1.2fr 1fr auto;
  gap: 14px;
  margin-bottom: 36px;
}
.field label { display: block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--gris-texto); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--gris-borde); border-radius: 8px;
  font-family: var(--font-sans); font-size: .95rem; background: var(--white); color: var(--grafito);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--guinda); box-shadow: 0 0 0 3px var(--guinda-soft); }

.perito-card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 24px; display: flex; gap: 18px; align-items: flex-start;
  border: 1px solid var(--gris-borde);
}
.perito-avatar {
  width: 76px; height: 76px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--guinda-soft); flex-shrink: 0;
  background: var(--guinda-soft); color: var(--guinda);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-weight: 700; font-size: 1.4rem;
}
.perito-info h3 { font-size: 1.08rem; margin-bottom: 4px; }
.perito-meta { font-size: .85rem; color: var(--gris-texto); margin: 2px 0; }
.perito-meta strong { color: var(--grafito); }

.badge {
  display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; letter-spacing: .03em;
}
.badge-activo { background: #e5f4ea; color: var(--success); }
.badge-suspendido { background: #fdf2df; color: var(--warning); }
.badge-baja { background: #fbe8e6; color: var(--danger); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--gris-texto); }

/* ---------- Formularios (contacto / admin) ---------- */
.form-card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 36px; max-width: 640px; margin: 0 auto;
}
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--grafito); }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--gris-borde); border-radius: 8px;
  font-family: var(--font-sans); font-size: .95rem; color: var(--grafito);
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none; border-color: var(--guinda); box-shadow: 0 0 0 3px var(--guinda-soft);
}
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.alert { padding: 14px 18px; border-radius: 8px; font-size: .9rem; margin-bottom: 20px; }
.alert-success { background: #e5f4ea; color: var(--success); border: 1px solid #b9e3c4; }
.alert-error { background: #fbe8e6; color: var(--danger); border: 1px solid #f0c2bd; }
.credencial-chip {
  display: inline-block; font-family: 'Courier New', monospace; font-weight: 700;
  background: rgba(0,0,0,.06); padding: 3px 10px; border-radius: 6px; letter-spacing: .03em;
  user-select: all;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--grafito); color: #cfcfcf; margin-top: 60px; }
.footer-inner { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 36px; padding: 60px 24px 40px; }
.footer-col h4 { color: var(--white); font-size: 1rem; margin-bottom: 16px; }
.footer-col a { display: block; color: #b8b5b6; margin-bottom: 8px; font-size: .92rem; }
.footer-col a:hover { color: var(--white); }
.footer-col p { font-size: .88rem; color: #b8b5b6; margin: 0 0 8px; }
.footer-logo { height: 46px; filter: brightness(0) invert(1); margin-bottom: 16px; }
.footer-bottom { border-top: 1px solid #4a4a4a; padding: 18px 24px; text-align: center; font-size: .82rem; color: #999; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 60px; }
  .hero-emblem { order: -1; }
  .hero-emblem img { width: 180px; }
  .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .directorio-toolbar { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--white); flex-direction: column; align-items: flex-start;
    padding: 18px 24px; box-shadow: var(--shadow-md); gap: 4px;
  }
  .main-nav.open { display: flex; }
  .main-nav a { width: 100%; padding: 10px 0; }
  .btn-nav-cta { margin-top: 8px; text-align: center; }
  .topbar-contact span:last-child { display: none; }
  .hero h1 { font-size: 2.1rem; }
  .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .directorio-toolbar { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .perito-card { flex-direction: column; text-align: center; align-items: center; }
}

/* ---------- Admin panel ---------- */
.admin-body { background: #f1eef0; min-height: 100vh; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 260px; background: var(--grafito); color: #d8d5d6; flex-shrink: 0;
  display: flex; flex-direction: column; padding: 24px 0;
}
.admin-sidebar .brand-box { padding: 0 24px 24px; border-bottom: 1px solid #4a4a4a; margin-bottom: 20px; }
.admin-sidebar .brand-box img { height: 40px; filter: brightness(0) invert(1); }
.admin-nav a {
  display: flex; align-items: center; gap: 12px; padding: 12px 24px; color: #d8d5d6;
  font-size: .92rem; font-weight: 500; border-left: 3px solid transparent;
}
.admin-nav a:hover { background: rgba(255,255,255,.05); color: var(--white); }
.admin-nav a.active { background: rgba(113,11,34,.35); border-left-color: var(--guinda-light); color: var(--white); }
.admin-sidebar .sidebar-footer { margin-top: auto; padding: 20px 24px 0; border-top: 1px solid #4a4a4a; }

.admin-main { flex: 1; min-width: 0; }
.admin-topbar {
  background: var(--white); padding: 16px 32px; display: flex; justify-content: space-between; align-items: center;
  box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 10;
}
.admin-content { padding: 32px; }
.admin-user { display: flex; align-items: center; gap: 12px; font-size: .9rem; }
.admin-user .avatar-circle {
  width: 36px; height: 36px; border-radius: 50%; background: var(--guinda); color: var(--white);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem;
}

.admin-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
.admin-stat { background: var(--white); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); border-left: 4px solid var(--guinda); }
.admin-stat .num { font-family: var(--font-serif); font-size: 2rem; color: var(--grafito); }
.admin-stat .label { font-size: .82rem; color: var(--gris-texto); text-transform: uppercase; letter-spacing: .03em; }

.panel { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 26px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }

table.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data-table th {
  text-align: left; padding: 12px 14px; background: #f7f5f6; color: var(--grafito);
  font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; border-bottom: 2px solid var(--gris-borde);
}
table.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--gris-borde); vertical-align: middle; }
table.data-table tr:hover { background: #fbf7f8; }
.table-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--guinda-soft); }
.actions-cell { display: flex; gap: 8px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--gris-borde); background: var(--white); cursor: pointer; color: var(--grafito);
}
.icon-btn:hover { background: var(--guinda-soft); border-color: var(--guinda); color: var(--guinda); }
.icon-btn.danger:hover { background: #fbe8e6; border-color: var(--danger); color: var(--danger); }

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--guinda) 0%, var(--guinda-dark) 100%); padding: 20px;
}
.login-card { background: var(--white); border-radius: 16px; padding: 44px; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); text-align: center; }
.login-card img { height: 56px; margin: 0 auto 18px; filter: none; }

@media (max-width: 980px) {
  .admin-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; padding: 14px 0; }
  .admin-nav { display: flex; overflow-x: auto; }
  .admin-nav a { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .admin-nav a.active { border-left: none; border-bottom-color: var(--guinda-light); }
  .admin-cards { grid-template-columns: 1fr; }
  .admin-content { padding: 18px; }
  table.data-table { display: block; overflow-x: auto; }
}
