/* ============================================================
   L.A.M ELECTRICIDAD — Design System
   Azul eléctrico #1E3A8A · Ámbar #F59E0B · Light default + Dark
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --brand-blue:   #1E3A8A;
  --brand-blue-2: #2547A8;
  --brand-amber:  #F59E0B;
  --brand-amber-2:#FBBF24;
  --radius:       14px;
  --radius-sm:    9px;
  --maxw:         1180px;
  --ease:         cubic-bezier(.16,.84,.36,1);
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
}

[data-theme="light"] {
  --bg-primary:    #FFFFFF;
  --bg-secondary:  #F3F5FA;
  --bg-tertiary:   #E9EDF6;
  --text-primary:  #0D1117;
  --text-secondary:#414B5E;
  --text-muted:    #7A8499;
  --border:        #D4DAE6;
  --border-strong: #B7C0D4;
  --accent:        #1E3A8A;
  --accent-hover:  #16306F;
  --accent-soft:   #E7ECF8;
  --accent-text:   #FFFFFF;
  --amber:         #B7740A;        /* ámbar legible sobre claro */
  --amber-bg:      #F59E0B;
  --amber-soft:    #FDF1DB;
  --danger:        #C0392B;
  --success:       #1A7A4A;
  --warning:       #B8650A;
  --surface:       #FFFFFF;
  --surface-2:     #FBFCFE;
  --shadow:        0 1px 2px rgba(16,30,70,.06), 0 8px 28px rgba(16,30,70,.08);
  --shadow-sm:     0 1px 2px rgba(16,30,70,.08);
  --hero-grad:     radial-gradient(120% 120% at 88% -10%, #2547A8 0%, #1E3A8A 42%, #14245C 100%);
  --grid-line:     rgba(30,58,138,.06);
}

[data-theme="dark"] {
  --bg-primary:    #0B0E16;
  --bg-secondary:  #11151F;
  --bg-tertiary:   #19202E;
  --text-primary:  #EEF1F8;
  --text-secondary:#A4AEC2;
  --text-muted:    #69738A;
  --border:        #232C3D;
  --border-strong: #33405A;
  --accent:        #4B6EF5;
  --accent-hover:  #5C7CF7;
  --accent-soft:   #16213F;
  --accent-text:   #FFFFFF;
  --amber:         #F9B547;
  --amber-bg:      #F59E0B;
  --amber-soft:    #2A2110;
  --danger:        #E05252;
  --success:       #3DBE7A;
  --warning:       #E8900A;
  --surface:       #11151F;
  --surface-2:     #141A26;
  --shadow:        0 1px 2px rgba(0,0,0,.4), 0 12px 36px rgba(0,0,0,.45);
  --shadow-sm:     0 1px 2px rgba(0,0,0,.5);
  --hero-grad:     radial-gradient(120% 120% at 88% -10%, #1B2B5C 0%, #13204A 45%, #0B1230 100%);
  --grid-line:     rgba(120,150,255,.05);
}

/* ---------- Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text; -moz-user-select: text; user-select: text;
}
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 15px; line-height: 1.6;
  background: var(--bg-secondary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background .3s var(--ease), color .3s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 5vw, 52px); }
h2 { font-size: clamp(24px, 3.4vw, 34px); }
h3 { font-size: 19px; }
h4 { font-size: 15px; }
p  { margin: 0; }
::selection { background: var(--brand-amber); color: #0D1117; }

.label {
  font-family: var(--font-mono);
  font-size: 11px; text-transform: uppercase; letter-spacing: .18em;
  color: var(--text-muted); font-weight: 500;
}
.mono { font-family: var(--font-mono); }

/* ---------- Voltage strip (firma) ---------- */
.voltage {
  height: 3px; width: 100%;
  background: repeating-linear-gradient(90deg,
     var(--brand-amber) 0 14px, transparent 14px 26px);
  background-size: 26px 3px;
  animation: voltage-run 1.1s linear infinite;
  opacity: .9;
}
@keyframes voltage-run { to { background-position: 26px 0; } }
@media (prefers-reduced-motion: reduce) { .voltage { animation: none; } }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.app-main { min-height: 100vh; padding-bottom: 40px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--amber); font-weight: 600;
}
.eyebrow::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand-amber); box-shadow: 0 0 0 3px var(--amber-soft);
}

/* ---------- Header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 800;
  background: color-mix(in srgb, var(--bg-primary) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.app-header.solid { background: var(--bg-primary); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 11px; cursor: pointer; }
.brand-mark {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: grid; place-items: center;
  background: var(--hero-grad); border-radius: 10px;
  color: #fff; position: relative; overflow: hidden;
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-mark::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(245,158,11,.35));
}
.brand-txt { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: .02em; }
.brand-sub  { font-family: var(--font-mono); font-size: 9px; letter-spacing: .22em; color: var(--text-muted); margin-top: 3px; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  display: grid; place-items: center; color: var(--text-secondary);
  transition: .2s var(--ease);
}
.theme-toggle:hover { border-color: var(--border-strong); color: var(--text-primary); }
.theme-toggle .icon-dark { display: none; }
[data-theme="dark"] .theme-toggle .icon-light { display: none; }
[data-theme="dark"] .theme-toggle .icon-dark { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 14px;
  padding: 12px 20px; border-radius: 11px; min-height: 44px;
  transition: transform .12s var(--ease), background .2s, box-shadow .2s, border-color .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-text); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-amber { background: var(--brand-amber); color: #1A1205; }
.btn-amber:hover { background: var(--brand-amber-2); }
.btn-secondary { background: var(--surface); color: var(--text-primary); border: 1px solid var(--border-strong); }
.btn-secondary:hover { background: var(--bg-tertiary); }
.btn-ghost { color: var(--text-secondary); padding: 10px 14px; }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 26px; font-size: 15px; min-height: 52px; }
.btn:disabled { opacity: .55; pointer-events: none; }

/* ---------- Cards / surfaces ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.panel-pad { padding: 22px; }

/* Tile métrica — esquina recortada + acento (no rectangular genérico) */
.metric {
  position: relative; background: var(--surface);
  border: 1px solid var(--border); border-left: 3px solid var(--brand-amber);
  border-radius: var(--radius-sm);
  padding: 18px 18px 16px; overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
  transition: transform .15s var(--ease), box-shadow .2s;
}
.metric:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.metric .m-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }
.metric .m-value { font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1; margin-top: 8px; color: var(--text-primary); }
.metric .m-foot  { font-size: 12px; color: var(--text-secondary); margin-top: 8px; }
.metric.accent-blue { border-left-color: var(--accent); }

/* ---------- Grid helpers ---------- */
.grid { display: grid; gap: 16px; }
.grid-metrics { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.grid-cards   { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* ---------- Quick-access tiles ---------- */
.qa-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.qa {
  display: flex; align-items: center; gap: 13px; text-align: left;
  padding: 16px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  transition: .18s var(--ease); width: 100%;
}
.qa:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.qa-ic {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 10px;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
}
.qa-ic svg { width: 20px; height: 20px; }
.qa-tx b { display: block; font-size: 14.5px; }
.qa-tx span { font-size: 12px; color: var(--text-muted); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em;
}
.badge.pendiente  { background: var(--amber-soft); color: var(--warning); }
.badge.confirmado, .badge.enviado, .badge.aceptado { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.badge.cancelado, .badge.rechazado { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.badge.completado { background: var(--accent-soft); color: var(--accent); }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 16px; }
.field > label {
  display: block; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 7px; font-weight: 600;
}
.input, textarea.input, select.input {
  width: 100%; padding: 13px 14px; font-size: 15px; font-family: var(--font-body);
  background: var(--bg-primary); color: var(--text-primary);
  border: 1px solid var(--border-strong); border-radius: 11px;
  transition: border-color .15s, box-shadow .15s; min-height: 48px;
}
.input:focus, textarea.input:focus, select.input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea.input { min-height: 110px; resize: vertical; line-height: 1.5; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast {
  padding: 12px 20px; border-radius: 11px; font-size: 14px; font-weight: 500;
  color: #fff; box-shadow: var(--shadow); max-width: 90vw;
  animation: toast-in .3s var(--ease);
}
.toast-error   { background: var(--danger); }
.toast-success { background: var(--success); }
.toast-warning { background: var(--warning); color: #1A1205; }
.toast-info    { background: var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Modal ---------- */
.modal-wrapper {
  position: fixed; inset: 0; z-index: 1000; padding: 16px;
  background: rgba(7,11,22,.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  animation: fade .2s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--radius); width: 100%; max-width: 560px; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow);
}
.modal-head { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 18px; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end; background: var(--bg-primary);
}
.modal-close { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--text-muted); }
.modal-close:hover { background: var(--bg-tertiary); color: var(--text-primary); }

/* ---------- Empty / error / loading ---------- */
.state {
  text-align: center; padding: 48px 22px; border: 1px dashed var(--border-strong);
  border-radius: var(--radius); background: var(--surface-2);
}
.state .s-ic { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.state .s-ic svg { width: 26px; height: 26px; }
.state h3 { margin-bottom: 6px; }
.state p { color: var(--text-secondary); margin-bottom: 16px; }
.skeleton { background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%); background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: var(--radius-sm); }
@keyframes sk { to { background-position: -200% 0; } }
.spinner { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- WhatsApp FAB ---------- */
.wa-fab {
  position: fixed; right: 18px; bottom: 22px; z-index: 900;
  width: 58px; height: 58px; border-radius: 50%;
  background: #25D366; color: #fff; display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(37,211,102,.45); transition: transform .18s var(--ease);
}
.wa-fab:hover { transform: scale(1.06); }
.wa-fab svg { width: 30px; height: 30px; }
.wa-fab::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 rgba(37,211,102,.5); animation: wa-pulse 2.4s infinite; }
@keyframes wa-pulse { 0% { box-shadow: 0 0 0 0 rgba(37,211,102,.45); } 70% { box-shadow: 0 0 0 16px rgba(37,211,102,0); } 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); } }
@media (prefers-reduced-motion: reduce) { .wa-fab::after { animation: none; } }

/* ---------- Mobile footer nav ---------- */
.footer-nav { display: none; }
@media (max-width: 768px) {
  .footer-nav {
    position: fixed; left: 0; right: 0; bottom: 0; height: 64px; z-index: 850;
    background: var(--bg-primary); border-top: 1px solid var(--border);
    display: flex; padding-bottom: env(safe-area-inset-bottom);
  }
  .footer-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; font-size: 10px; color: var(--text-muted); min-height: 44px;
  }
  .footer-nav button svg { width: 21px; height: 21px; }
  .footer-nav button.active { color: var(--accent); }
  .app-main { padding-bottom: 84px; }
  .wa-fab { bottom: 78px; }
}

/* ---------- Splash ---------- */
#splash {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--hero-grad);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity .5s var(--ease);
}
#splash .sp-grid { position: absolute; inset: 0; background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 44px 44px; opacity: .5; }
.sp-mark { width: 84px; height: 84px; border-radius: 20px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); display: grid; place-items: center; color: #fff; position: relative; z-index: 1; }
.sp-mark svg { width: 46px; height: 46px; animation: sp-bolt 1.6s ease-in-out infinite; }
@keyframes sp-bolt { 0%,100% { opacity: .85; filter: drop-shadow(0 0 0 rgba(245,158,11,0)); } 50% { opacity: 1; filter: drop-shadow(0 0 10px rgba(245,158,11,.8)); } }
.sp-name { font-family: var(--font-display); font-weight: 700; font-size: 30px; color: #fff; margin-top: 22px; letter-spacing: .04em; z-index: 1; }
.sp-sub { font-family: var(--font-mono); font-size: 11px; letter-spacing: .3em; color: rgba(255,255,255,.6); margin-top: 8px; z-index: 1; }
.sp-bar { width: 210px; height: 3px; background: rgba(255,255,255,.16); border-radius: 3px; margin-top: 32px; overflow: hidden; z-index: 1; }
.sp-bar > i { display: block; height: 100%; width: 0; background: var(--brand-amber); border-radius: 3px; transition: width .1s linear; }

/* ---------- Hero (home) ---------- */
.hero { position: relative; background: var(--hero-grad); color: #fff; overflow: hidden; }
.hero .sp-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 48px 48px; }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.25fr .75fr; gap: 30px; padding: 64px 0 72px; align-items: center; }
.hero h1 { color: #fff; }
.hero h1 b { color: var(--brand-amber-2); }
.hero-lead { color: rgba(255,255,255,.82); font-size: 17px; max-width: 46ch; margin: 18px 0 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-side { display: flex; flex-direction: column; gap: 12px; }
.hero-stat { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius-sm); padding: 16px 18px; }
.hero-stat .v { font-family: var(--font-display); font-weight: 700; font-size: 27px; color: var(--brand-amber-2); }
.hero-stat .l { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.6); margin-top: 4px; }

.section { padding: 56px 0; }
.section-head { margin-bottom: 28px; }
.section-head h2 { margin-top: 10px; }

/* service / work cards */
.svc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: .2s var(--ease); display: flex; flex-direction: column; }
.svc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.svc-media { aspect-ratio: 16/10; background: var(--bg-tertiary); position: relative; overflow: hidden; }
.svc-media img { width: 100%; height: 100%; object-fit: cover; }
.svc-media .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-muted); background: var(--hero-grad); }
.svc-media .ph svg { width: 40px; height: 40px; opacity: .5; }
.svc-cat { position: absolute; top: 10px; left: 10px; }
.svc-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.svc-body h3 { font-size: 17px; }
.svc-body p { font-size: 13.5px; color: var(--text-secondary); line-height: 1.5; }
.svc-price { margin-top: auto; font-family: var(--font-mono); font-size: 13px; color: var(--amber); font-weight: 600; }
.svc-price b { font-size: 16px; color: var(--text-primary); }

.list { display: flex; flex-direction: column; gap: 10px; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.row .r-main { flex: 1; min-width: 0; }
.row .r-main b { font-size: 14.5px; }
.row .r-main span { display: block; font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.divider-volt { height: 3px; background: repeating-linear-gradient(90deg, var(--brand-amber) 0 14px, transparent 14px 26px); background-size: 26px 3px; opacity: .55; margin: 0; }

/* contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.contact-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.contact-item .ci-ic { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.contact-item .ci-ic svg { width: 18px; height: 18px; }
.contact-item b { font-size: 14px; }
.contact-item span { font-size: 13px; color: var(--text-secondary); }
.map-embed { width: 100%; min-height: 280px; border: 1px solid var(--border); border-radius: var(--radius); }

.page-head { padding: 30px 0 8px; }
.page-head .eyebrow { margin-bottom: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; gap: 26px; padding: 44px 0 52px; }
  .hero-side { flex-direction: row; flex-wrap: wrap; }
  .hero-stat { flex: 1; min-width: 120px; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .header-actions .btn-label { display: none; }
  .brand-sub { display: none; }
  .section { padding: 40px 0; }
}

/* utility */
.hide { display: none !important; }
.mt0{margin-top:0}.mb0{margin-bottom:0}
.flex{display:flex}.aic{align-items:center}.jcb{justify-content:space-between}.gap8{gap:8px}.gap12{gap:12px}
.txt-muted{color:var(--text-muted)}.txt-sec{color:var(--text-secondary)}
.fade-in{animation:fade .35s var(--ease)}
