/* ============================================================
   Courant Maître Électricien — Design System
   Fuentes: Plus Jakarta Sans (títulos) + Inter (cuerpo)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap');

/* ── Variables ───────────────────────────────────────────── */
:root {
  /* Colores principales */
  --primary:           #0B192C;
  --primary-light:     #1E3E62;
  --accent:            #F59E0B;
  --accent-dark:       #D97706;
  --surface:           #F8FAFC;
  --surface-card:      #FFFFFF;
  --surface-muted:     #F1F5F9;
  --border:            #E2E8F0;
  --border-hover:      #CBD5E1;
  --text:              #0F172A;
  --text-muted:        #64748B;
  --text-light:        #94A3B8;
  --success:           #059669;
  --error:             #DC2626;
  --warning:           #D97706;

  /* Tipografía */
  --font-head:   'Plus Jakarta Sans', sans-serif;
  --font-body:   'Inter', sans-serif;

  /* Bordes */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-full: 9999px;

  /* Sombras */
  --shadow-sm:   0 1px 3px rgba(11,25,44,.04), 0 4px 6px rgba(11,25,44,.02);
  --shadow-md:   0 4px 12px rgba(11,25,44,.08);
  --shadow-lg:   0 10px 25px -5px rgba(11,25,44,.12), 0 8px 10px -6px rgba(11,25,44,.04);

  /* Espaciado */
  --gutter:      1.5rem;
  --gutter-sm:   1rem;
  --container:   1280px;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
ul, ol { list-style: none; }

/* ── Tipografía ──────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; }
.display { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; letter-spacing: -0.03em; }
.headline-lg { font-size: clamp(1.75rem, 3vw, 2.25rem); letter-spacing: -0.02em; }
.headline-md { font-size: 1.5rem; letter-spacing: -0.01em; }
.headline-sm { font-size: 1.25rem; letter-spacing: -0.005em; }
.label       { font-family: var(--font-head); font-size: .875rem; font-weight: 600; letter-spacing: .02em; }
.label-sm    { font-family: var(--font-head); font-size: .75rem;  font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.body-lg     { font-size: 1.125rem; line-height: 1.6; }
.body-sm     { font-size: .875rem;  line-height: 1.45; }

/* ── Layout ──────────────────────────────────────────────── */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
@media (max-width: 768px) { .container { padding-inline: var(--gutter-sm); } }

.grid-2  { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3  { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4  { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px)  { .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; } }

/* ── Botones ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-head); font-size: .875rem; font-weight: 700;
  padding: .75rem 1.5rem; border-radius: var(--radius-sm);
  border: none; transition: all .2s ease; white-space: nowrap;
}
.btn-primary  { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-light); }
.btn-accent   { background: var(--accent); color: var(--primary); }
.btn-accent:hover  { background: var(--accent-dark); }
.btn-outline  { background: #fff; color: var(--primary); border: 1px solid var(--border-hover); }
.btn-outline:hover { background: var(--surface-muted); border-color: var(--primary); }
.btn-sm       { padding: .5rem 1rem; font-size: .75rem; }
.btn-lg       { padding: 1rem 2rem; font-size: 1rem; }
.btn-icon .material-symbols-outlined { font-size: 18px; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  overflow: hidden; transition: box-shadow .25s ease, border-color .25s ease;
}
.card:hover { box-shadow: var(--shadow-lg); border-color: var(--border-hover); }
.card-body  { padding: 1.5rem; }

/* ── Navbar ──────────────────────────────────────────────── */
.navbar-top {
  background: var(--primary); color: #fff;
  padding: .375rem 0; font-size: .6875rem; letter-spacing: .06em;
}
.navbar-main {
  background: rgba(248,250,252,.95); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 80px; display: flex; align-items: center;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,.04);
}
.navbar-main .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--text); }
.brand-name { font-family: var(--font-head); font-size: 1.25rem; font-weight: 600; line-height: 1.1; letter-spacing: -.01em; }
.brand-tag  { font-size: .6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-dark); }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a {
  font-family: var(--font-head); font-size: .875rem; font-weight: 600; letter-spacing: .02em;
  color: var(--text-muted); transition: color .2s; padding: .5rem; border-radius: var(--radius-sm);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--surface-muted); }
.lang-switcher {
  display: inline-flex; background: var(--border); border-radius: var(--radius-full); padding: 2px; gap: 2px;
}
.lang-switcher button {
  padding: .25rem .625rem; border-radius: var(--radius-full); border: none; background: transparent;
  font-family: var(--font-head); font-size: .75rem; font-weight: 700; letter-spacing: .05em;
  color: var(--text-muted); transition: all .15s;
}
.lang-switcher button.active { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.hamburger { display: none; background: none; border: none; padding: .5rem; color: var(--text); }
@media (max-width: 1024px) { .nav-links { display: none; } .hamburger { display: flex; } }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  background: var(--primary); color: #fff; padding: 5rem 0;
  position: relative; overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 2.5rem; align-items: center; }
@media (max-width: 1024px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--primary-light); border-radius: var(--radius-full);
  padding: .375rem 1rem; font-size: .6875rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: 1.25rem;
}
.hero-badge .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.3)} }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.5rem; }
.trust-badges { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 1.5rem; }
.trust-badge  { display: flex; align-items: center; gap: .375rem; font-size: .6875rem; opacity: .8; }

/* ── Stats bar ───────────────────────────────────────────── */
.stats-bar { background: var(--surface-muted); padding: 2rem 0; }
.stat-card  { background: #fff; border-radius: var(--radius-md); padding: 1.25rem; box-shadow: var(--shadow-sm); }
.stat-num   { font-family: var(--font-head); font-size: 2.25rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: .6875rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); margin-top: .5rem; }

/* ── Service cards ───────────────────────────────────────── */
.service-card img { width: 100%; height: 176px; object-fit: cover; transition: transform .3s; }
.service-card:hover img { transform: scale(1.05); }
.service-card .img-wrap { overflow: hidden; border-radius: var(--radius-sm); margin-bottom: 1rem; }
.service-card .icon-box {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--primary); display: flex; align-items: center; justify-content: center;
  margin-bottom: .75rem;
}
.service-card .icon-box .material-symbols-outlined { font-size: 20px; color: var(--accent); }
.service-card .footer { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--border); }

/* ── Project cards ───────────────────────────────────────── */
.project-card { position: relative; border-radius: var(--radius-md); overflow: hidden; }
.project-card img { width: 100%; height: 220px; object-fit: cover; }
.project-card .overlay {
  position: absolute; inset: 0; background: linear-gradient(to top, rgba(11,25,44,.9), transparent 50%);
  padding: 1.25rem; display: flex; flex-direction: column; justify-content: flex-end; color: #fff;
}
.project-badge {
  display: inline-block; background: var(--accent); color: var(--primary);
  font-size: .6875rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: .2rem .5rem; border-radius: var(--radius-sm); margin-bottom: .5rem;
}

/* ── Formulario ──────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .375rem; color: var(--text); }
.form-label .required { color: var(--error); margin-left: .2rem; }
.form-control {
  width: 100%; height: 48px; padding: 0 1rem;
  border: 1px solid var(--border-hover); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 1rem; color: var(--text);
  background: #fff; transition: border-color .2s, box-shadow .2s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(11,25,44,.12); }
textarea.form-control { height: auto; padding: .75rem 1rem; resize: vertical; min-height: 120px; }
select.form-control { appearance: none; cursor: pointer; }
.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; }
.form-error { font-size: .75rem; color: var(--error); margin-top: .25rem; display: none; }
.has-error .form-control { border-color: var(--error); }
.has-error .form-error   { display: block; }
.dropzone {
  border: 2px dashed var(--border-hover); border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s; background: var(--surface-muted);
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: #fffbeb; }
.dropzone .material-symbols-outlined { font-size: 40px; color: var(--text-light); display: block; margin: 0 auto .75rem; }
.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
@media (max-width: 640px) { .type-grid { grid-template-columns: repeat(2, 1fr); } }
.type-option { position: relative; }
.type-option input { position: absolute; opacity: 0; }
.type-option label {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  padding: .875rem .75rem; border: 2px solid var(--border); border-radius: var(--radius-md);
  cursor: pointer; transition: all .2s; text-align: center; background: #fff;
  font-size: .75rem; font-weight: 600; font-family: var(--font-head);
}
.type-option input:checked + label { border-color: var(--accent); background: #fffbeb; color: var(--primary); }
.type-option label .material-symbols-outlined { font-size: 28px; color: var(--text-muted); }
.type-option input:checked + label .material-symbols-outlined { color: var(--accent-dark); }

/* ── Footer ──────────────────────────────────────────────── */
.footer { background: var(--primary); color: #fff; padding: 3.5rem 0 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 2rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,.08); }
@media (max-width: 1024px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .footer-grid { grid-template-columns: 1fr; } }
.footer h4 { font-size: .875rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.footer a  { color: rgba(255,255,255,.65); font-size: .875rem; line-height: 2; transition: color .2s; display: block; }
.footer a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 1.5rem; flex-wrap: wrap; gap: .75rem; }
.footer-bottom p { font-size: .75rem; opacity: .45; }
.rbq-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-md); padding: .5rem .875rem;
  font-family: var(--font-head); font-size: .6875rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.rbq-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); animation: pulse 2s infinite; }

/* ── Admin Layout ────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--primary); color: #fff;
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 200;
  overflow-y: auto;
}
.sidebar-logo { padding: 1.25rem 1.5rem 1rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-logo .app-name { font-family: var(--font-head); font-size: 1.125rem; font-weight: 700; }
.sidebar-logo .app-sub  { font-size: .6875rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); opacity: .9; }
.sidebar nav { flex: 1; padding: 1rem 0; }
.sidebar-group { padding: .5rem 1.5rem .25rem; font-size: .625rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.35); }
.sidebar a {
  display: flex; align-items: center; gap: .75rem;
  padding: .625rem 1.5rem; font-size: .875rem; font-weight: 500;
  color: rgba(255,255,255,.65); transition: all .15s; border-left: 3px solid transparent;
}
.sidebar a:hover    { color: #fff; background: rgba(255,255,255,.06); }
.sidebar a.active   { color: #fff; background: rgba(255,255,255,.1); border-left-color: var(--accent); }
.sidebar a .material-symbols-outlined { font-size: 20px; }
.badge-count {
  margin-left: auto; background: var(--accent); color: var(--primary);
  font-size: .6875rem; font-weight: 700; border-radius: var(--radius-full); padding: .1rem .45rem; min-width: 20px; text-align: center;
}
.sidebar-footer { padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .8125rem; }
.sidebar-footer .user-name { font-weight: 600; }
.sidebar-footer .user-role { font-size: .6875rem; opacity: .55; }
.admin-main { margin-left: 240px; flex: 1; display: flex; flex-direction: column; }
.admin-topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 2rem; gap: 1rem;
  position: sticky; top: 0; z-index: 100;
}
.admin-content { padding: 2rem; flex: 1; }
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; }
.page-header p  { color: var(--text-muted); margin-top: .25rem; }

/* ── Status pills ────────────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: .375rem; padding: .25rem .625rem; border-radius: var(--radius-full); font-size: .6875rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.pill-new      { background: #dbeafe; color: #1d4ed8; }
.pill-eval     { background: #fef3c7; color: #92400e; }
.pill-sent     { background: #d1fae5; color: #065f46; }
.pill-approved { background: #dcfce7; color: #14532d; }
.pill-archived { background: #f1f5f9; color: #475569; }
.pill-draft    { background: #f1f5f9; color: #475569; }
.pill-active   { background: #d1fae5; color: #065f46; }
.pill-error    { background: #fee2e2; color: #991b1b; }

/* ── Tables ──────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table th { padding: .75rem 1rem; text-align: left; font-size: .6875rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); background: var(--surface-muted); border-bottom: 1px solid var(--border); }
.data-table td { padding: .875rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-muted); }

/* ── Alerts ──────────────────────────────────────────────── */
.alert { padding: .875rem 1rem; border-radius: var(--radius-md); margin-bottom: 1rem; display: flex; gap: .625rem; align-items: flex-start; font-size: .875rem; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.alert-info    { background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }

/* ── Utilities ───────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }
.text-muted   { color: var(--text-muted); }
.text-accent  { color: var(--accent-dark); }
.text-success { color: var(--success); }
.text-error   { color: var(--error); }
.d-flex       { display: flex; }
.gap-1        { gap: .5rem; }
.gap-2        { gap: 1rem; }
.gap-3        { gap: 1.5rem; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap    { flex-wrap: wrap; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }
.p-2 { padding: 1rem; } .p-3 { padding: 1.5rem; } .p-4 { padding: 2rem; }
.rounded { border-radius: var(--radius-md); }
.w-full { width: 100%; }
.bg-white { background: #fff; }
.shadow { box-shadow: var(--shadow-sm); }

/* ── Responsive mobile nav ───────────────────────────────── */
.mobile-nav {
  display: none; position: fixed; inset: 0; background: var(--primary); z-index: 999;
  flex-direction: column; padding: 2rem;
}
.mobile-nav.open { display: flex; }
.mobile-nav a { color: #fff; font-size: 1.25rem; font-weight: 600; padding: 1rem 0; border-bottom: 1px solid rgba(255,255,255,.1); }
