/* SunVault — site styles */
:root {
  /* Brand palette pulled from the SunVolt Green Energy logo:
     orange sun + lightning, leaf green, deep navy text on warm cream. */
  --sun:       #f58a1f;  /* logo orange (lightning bolt / sun core)     */
  --sun-dark:  #d9601a;  /* deeper orange — hover / gradient endpoint   */
  --sun-soft:  #fbc15c;  /* light warm yellow — backgrounds / chips     */
  --leaf:      #2e8b2e;  /* logo leaf green                             */
  --leaf-dark: #1f6e1f;  /* deep green — hover / accents                */
  --leaf-soft: #c8e6c0;  /* faint green tint — success backgrounds      */
  --sky:       #0f2a4a;  /* navy from "SUNVOLT" text — links / bands    */
  --ink:       #0f2a4a;  /* primary text                                */
  --muted:     #5b6470;
  --bg:        #faf6ec;  /* warm cream paper, like the logo backdrop    */
  --panel:     #ffffff;
  --border:    #e5dfcc;  /* warm beige border                           */
  --ok:        #2e8b2e;  /* aligned with leaf green                     */
  --warn:      #b7791f;
  --danger:    #c0392b;
  --info:      #1d6fb8;
  --radius:    10px;
  --shadow:    0 4px 14px rgba(15, 42, 74, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--sky); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6rem; }
h1 { font-size: 2.3rem; }
h2 { font-size: 1.6rem; margin-top: 0; }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1rem; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 3rem 0; }
.section.narrow { max-width: 820px; }
.accent { color: var(--sun-dark); }

/* ---------- Header / nav ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.25rem; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.35rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--sun); color: #fff; font-size: 1.1rem;
}
.brand-logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}
.primary-nav a {
  color: var(--ink); margin-left: 1.25rem; font-weight: 500;
}
.primary-nav a.cta {
  background: var(--sun); color: #fff; padding: .55rem 1rem;
  border-radius: var(--radius);
}
.primary-nav a.cta:hover { background: var(--sun-dark); text-decoration: none; }

/* ---------- Flashes ---------- */
.flashes { padding-top: 1rem; }
.flash {
  padding: .7rem 1rem; border-radius: var(--radius);
  margin-bottom: .6rem; border: 1px solid transparent;
}
.flash-success { background: #e8f6ee; border-color: #b6e2c5; color: #1f6e1f; }
.flash-warning { background: #fff7e6; border-color: #f5d59b; color: #7a4d00; }
.flash-info    { background: #e7f1fb; border-color: #b6d3ee; color: #134a78; }
.flash-danger  { background: #fdecea; border-color: #f3b9b3; color: #76211a; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: .7rem 1.2rem; border-radius: var(--radius);
  font-weight: 600; border: 1px solid transparent; cursor: pointer;
  font-size: .95rem; margin-right: .5rem;
}
.btn-primary { background: var(--sun); color: #fff; }
.btn-primary:hover { background: var(--sun-dark); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { background: #f3f1ea; text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8d2a20; text-decoration: none; }
.btn-sm { padding: .35rem .7rem; font-size: .85rem; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #fdf6e3 0%, #fae3b6 50%, #f7d49a 100%);
  padding: 4rem 0 3rem;
}
.hero-grid {
  display: grid; grid-template-columns: 1.4fr 1fr;
  gap: 2.5rem; align-items: center;
}
.hero .lead { font-size: 1.1rem; color: var(--muted); }
.hero-cta { margin: 1.2rem 0 1.6rem; }
.hero-bullets { list-style: none; padding: 0; margin: 0; color: var(--ink); font-weight: 500; }
.hero-bullets li { padding: .25rem 0; }
.hero-card {
  background: #fff; padding: 1.6rem; border-radius: var(--radius);
  box-shadow: var(--shadow); border-top: 4px solid var(--sun);
}

/* ---------- Sections / cards ---------- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 1.4rem;
}
.link { font-weight: 600; }
.cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem;
}
.card {
  background: var(--panel); padding: 1.4rem; border-radius: var(--radius);
  box-shadow: var(--shadow); border-top: 3px solid var(--sun);
}
.card ul { padding-left: 1.2rem; color: var(--muted); margin: .5rem 0 0; }

.team-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1.4rem; margin: 1rem 0 2rem;
}
.team-card {
  background: var(--panel); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.2rem;
  display: flex; gap: 1rem; align-items: flex-start;
}
.team-photo {
  width: 160px; height: 200px; border-radius: 10px;
  object-fit: cover; object-position: center top;
  flex: 0 0 auto; background: #eef2f6;
}
.team-photo-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; font-weight: 700; color: var(--muted);
}
.team-info { flex: 1; }
.team-info h3 { margin: 0 0 .15rem; }
.team-role { color: var(--muted); font-weight: 600; margin: 0 0 .5rem; }

/* ---------- WhatsApp floating chat button ---------- */
.whatsapp-fab {
  position: fixed; right: 1.2rem; bottom: 1.2rem;
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .85rem 1.1rem;
  background: #25D366; color: #fff;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
  z-index: 1000;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.whatsapp-fab:hover {
  background: #1ebe5d; color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
}
.whatsapp-fab svg { display: block; }
.whatsapp-fab-label { font-weight: 600; font-size: .95rem; }
@media (max-width: 520px) {
  .whatsapp-fab { padding: .8rem; }
  .whatsapp-fab-label { display: none; }
}

.band { background: var(--sky); color: #fff; padding: 2rem 0; }
.band-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; text-align: center;
}
.band-grid strong { display: block; font-size: 1.8rem; color: var(--sun); }
.band-grid span { color: rgba(255,255,255,.8); font-size: .9rem; }

.cta-band {
  background: linear-gradient(135deg, var(--sun) 0%, var(--sun-dark) 100%);
  color: #fff; text-align: center; padding: 2.5rem 0; margin-top: 2rem;
}
.cta-band h2, .cta-band p { color: #fff; }
.cta-band .btn-primary {
  background: #fff; color: var(--sun-dark);
}
.cta-band .btn-primary:hover { background: #f3f1ea; }

/* ---------- Page hero ---------- */
.page-hero {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 2.5rem 0 1.8rem;
}
.page-hero .lead { color: var(--muted); }

/* ---------- Videos ---------- */
.video-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem;
}
.video-card {
  background: var(--panel); margin: 0; border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.video-embed {
  position: relative; padding-bottom: 56.25%; height: 0; background: #000;
}
.video-embed iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.video-card figcaption { padding: 1rem 1.2rem 1.2rem; }
.video-card ul { padding-left: 1.1rem; color: var(--muted); margin: .4rem 0 0; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: start;
}
.contact-form {
  background: var(--panel); padding: 1.6rem; border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: .65rem .8rem; border: 1px solid var(--border);
  border-radius: 8px; font-size: 1rem; font-family: inherit; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--sun); outline-offset: 1px; border-color: var(--sun);
}
.grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.error { color: var(--danger); font-weight: 600; }
.hint { color: var(--muted); font-size: .85rem; margin-top: .6rem; }
.contact-aside {
  background: #fff8e8; padding: 1.6rem; border-radius: var(--radius);
  border-left: 4px solid var(--sun);
}
.mt { margin-top: 1.2rem; }
.region-list { padding-left: 1.2rem; color: var(--muted); }
.promise-list { padding-left: 1.2rem; }

/* ---------- Admin ---------- */
.admin-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem;
}
.stat-row {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: .8rem; margin-bottom: 1.4rem;
}
.stat {
  background: var(--panel); padding: 1rem; border-radius: var(--radius);
  box-shadow: var(--shadow); text-align: center; border-top: 3px solid var(--border);
}
.stat strong { display: block; font-size: 1.5rem; }
.stat span { color: var(--muted); text-transform: capitalize; font-size: .85rem; }
.stat-new       { border-top-color: var(--sun); }
.stat-contacted { border-top-color: var(--info); }
.stat-quoted    { border-top-color: var(--warn); }
.stat-won       { border-top-color: var(--ok); }
.stat-lost      { border-top-color: var(--danger); }
.stat-total     { border-top-color: var(--sky); background: #f5f8ff; }

.filter-bar {
  display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem;
  background: var(--panel); padding: 1rem; border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.filter-bar input, .filter-bar select {
  padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 8px;
  font-size: .95rem; background: #fff;
}
.filter-bar input { flex: 1; min-width: 220px; }

.table-wrap { overflow-x: auto; background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); }
.leads-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.leads-table th, .leads-table td {
  padding: .7rem .8rem; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.leads-table th { background: #f6f4ec; font-weight: 700; }
.leads-table .msg { max-width: 320px; color: var(--muted); }
.leads-table .empty { text-align: center; color: var(--muted); padding: 2rem; }
.inline-form { display: inline; margin: 0; }
.inline-form select { padding: .35rem .5rem; border: 1px solid var(--border); border-radius: 6px; }

/* ---------- Admin: charts ---------- */
.chart-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem;
  margin-bottom: 1.4rem;
}
.chart-card {
  background: var(--panel); padding: 1rem 1.1rem 1.2rem;
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.chart-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .8rem; margin-bottom: .6rem; flex-wrap: wrap;
}
.chart-head h3 { margin: 0; }
.chart-period {
  padding: .4rem .6rem; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; font-size: .9rem;
}
.chart-canvas-wrap { position: relative; height: 280px; }
.chart-canvas-wrap canvas { width: 100% !important; height: 100% !important; }
.hidden { display: none !important; }

/* Inline lead-edit inputs */
.agent-input, .deal-input {
  padding: .35rem .5rem; border: 1px solid var(--border); border-radius: 6px;
  font-size: .9rem; max-width: 120px;
}
.deal-input { max-width: 110px; }

/* ---------- Admin: content editor ---------- */
.admin-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.mt-xl { margin-top: 3rem; }

.content-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem;
  margin-bottom: 1.6rem;
}
.content-card {
  background: var(--panel); padding: 1.1rem 1.2rem; border-radius: var(--radius);
  box-shadow: var(--shadow); border-top: 3px solid var(--sun);
  display: flex; flex-direction: column;
}
.content-card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: .8rem; margin-bottom: .8rem;
}
.content-card .field { margin-bottom: .7rem; }
.content-card-actions { margin-top: .4rem; display: flex; gap: .5rem; }

.add-block {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1rem 1.2rem; margin-bottom: 2rem; border-left: 4px solid var(--sky);
}
.add-block > summary {
  cursor: pointer; padding: .3rem 0; user-select: none;
}
.add-block .contact-form { box-shadow: none; padding: 0; background: transparent; }

.doc-list { display: flex; flex-direction: column; gap: .7rem; margin-bottom: 1.4rem; }
.doc-row {
  background: var(--panel); padding: .8rem 1rem; border-radius: var(--radius);
  box-shadow: var(--shadow); display: flex; flex-wrap: wrap;
  gap: .8rem; align-items: center; justify-content: space-between;
}
.doc-meta { display: flex; flex-direction: column; min-width: 240px; }
.doc-link { font-weight: 600; }
.doc-fields {
  display: flex; gap: .5rem; flex-wrap: wrap; align-items: center;
}
.doc-fields input {
  padding: .45rem .6rem; border: 1px solid var(--border); border-radius: 6px;
  font-size: .9rem; min-width: 140px;
}

/* ---------- Public documents list ---------- */
.doc-public-list { list-style: none; padding: 0; margin: 0; display: grid;
  grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.doc-public-item { margin: 0; }
.doc-public-link {
  display: flex; gap: .9rem; align-items: flex-start;
  background: var(--panel); padding: 1rem 1.1rem; border-radius: var(--radius);
  box-shadow: var(--shadow); border-left: 4px solid var(--sun); color: var(--ink);
}
.doc-public-link:hover { text-decoration: none; background: #fffaf0; }
.doc-icon { font-size: 1.6rem; line-height: 1; }
.doc-desc { color: var(--muted); }

code {
  background: #fff5e0; padding: .1rem .35rem; border-radius: 4px;
  font-family: SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 3rem; background: var(--ink); color: #cdd3df; padding: 2.5rem 0 1rem;
}
.site-footer h4 { color: #fff; margin-bottom: .5rem; }
.site-footer a { color: var(--sun); }
.footer-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
}
.copyright {
  border-top: 1px solid #2c3344; margin-top: 1.5rem; padding-top: 1rem;
  font-size: .85rem; color: #8a93a3;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid, .contact-grid, .video-grid, .footer-grid,
  .content-grid, .doc-public-list, .chart-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .band-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-row { grid-template-columns: repeat(3, 1fr); }
  .primary-nav a { margin-left: .8rem; font-size: .9rem; }
  h1 { font-size: 1.8rem; }
}
@media (max-width: 520px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .primary-nav a:not(.cta) { display: none; }
  .team-card { flex-direction: column; align-items: center; text-align: center; }
  .team-photo { width: 100%; max-width: 240px; height: 280px; }
}

/* ---------- Regional gallery (homepage) ---------- */
.region-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1.2rem;
}
.region-column-title {
  margin: 0 0 .6rem;
  font-size: 1.05rem;
  color: var(--sky);
  letter-spacing: .02em;
}
.region-tiles { display: grid; gap: .8rem; }
.region-tile {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.region-tile img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #e8ecf1; /* shows while the byte stream is still loading */
}
.region-tile figcaption {
  padding: .55rem .8rem .7rem;
  font-size: .9rem;
  color: var(--muted);
}
@media (max-width: 520px) {
  .region-gallery { grid-template-columns: 1fr; }
}
