/* =========================================================
   ENERVO — Main stylesheet
   Mobile-first · logical properties for automatic RTL/LTR ·
   Luxury-executive restraint with a single gold accent.
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Latin numerals/labels can opt into Inter */
.lat { font-family: var(--font-lat); }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.25; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.15rem; font-weight: 700; }
p  { margin: 0 0 1rem; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1.25rem; }
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--primary); margin-bottom: .6rem;
}

/* -------- Accessibility -------- */
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }
.skip-link {
  position: absolute; inset-inline-start: -999px; top: 0; z-index: 100;
  background: var(--gold); color: #16342A; padding: .6rem 1rem; border-radius: 0 0 var(--r-sm) var(--r-sm);
}
.skip-link:focus { inset-inline-start: 0; }
.sr-only {
  position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 700; cursor: pointer;
  padding: .72rem 1.4rem; border-radius: var(--r-pill);
  border: 1.5px solid transparent; transition: transform .15s var(--ease), background .2s, box-shadow .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--emerald-600); box-shadow: var(--shadow-md); }
.btn-accent { background: var(--gold); color: #16342A; box-shadow: var(--shadow-sm); }
.btn-accent:hover { background: var(--gold-600); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; border-color: currentColor; color: inherit; }
.btn-ghost:hover { background: color-mix(in oklab, currentColor 10%, transparent); }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .7; pointer-events: none; }
.btn.is-loading::after {
  content: ""; width: 1em; height: 1em; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   Header / navigation
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--forest) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  color: var(--hero-text); border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav { display: flex; align-items: center; gap: 1rem; height: 66px; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.25rem; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: var(--gold); color: #16342A; flex: none;
}
.brand small { display:block; font-size:.6rem; font-weight:600; letter-spacing:.14em; color:var(--gold); }
.nav-links { display: none; gap: .3rem; margin-inline-start: auto; }
.nav-links a { padding: .5rem .8rem; border-radius: var(--r-sm); font-weight: 600; opacity: .9; }
.nav-links a:hover, .nav-links a.active { opacity: 1; background: rgba(255,255,255,.10); }
.nav-actions { display: flex; align-items: center; gap: .5rem; margin-inline-start: auto; }
.nav-links + .nav-actions { margin-inline-start: 0; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer;
  border-radius: var(--r-pill); border: 1px solid rgba(255,255,255,.18);
  background: transparent; color: inherit; font-size: 1.05rem;
}
.icon-btn:hover { background: rgba(255,255,255,.12); }
.lang-switch { position: relative; }
.lang-switch summary { list-style: none; }
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-menu {
  position: absolute; inset-inline-end: 0; margin-top: .4rem; min-width: 130px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-md); overflow: hidden; z-index: 60;
}
.lang-menu a { display: block; padding: .55rem .9rem; font-weight: 600; }
.lang-menu a:hover { background: var(--surface-2); }
.nav-toggle { display: grid; }
@media (min-width: 860px) {
  .nav-links { display: flex; }
  .nav-toggle { display: none; }
}

/* mobile drawer */
.mobile-menu {
  display: none; background: var(--forest-700); color: var(--hero-text);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.mobile-menu.open { display: block; }
.mobile-menu a { display: block; padding: .85rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.06); font-weight: 600; }

/* =========================================================
   Hero — the "energy stem" signature
   ========================================================= */
.hero { background: var(--hero-bg); color: var(--hero-text); position: relative; overflow: hidden; }
.hero::before { /* soft ambient glow, top-inline-end */
  content: ""; position: absolute; inset-block-start: -25%; inset-inline-end: -10%;
  width: 55%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(242,185,12,.16), transparent 62%);
  pointer-events: none;
}
.hero-grid { display: grid; gap: 2rem; align-items: center; padding-block: clamp(3rem, 8vw, 5.5rem); }
.hero-title { color: #fff; }
.hero-lead { color: color-mix(in oklab, var(--hero-text) 82%, transparent); font-size: 1.12rem; max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.hero-trust { display: flex; gap: 1.4rem; margin-top: 2rem; flex-wrap: wrap; opacity: .85; font-size: .9rem; }
.hero-trust b { color: var(--gold); font-family: var(--font-lat); font-size: 1.15rem; }

/* Emblem card with the plug→plant motif */
.hero-emblem {
  background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.12); border-radius: var(--r-lg);
  padding: clamp(1.5rem, 4vw, 2.4rem); box-shadow: var(--shadow-lg);
  display: grid; place-items: center; min-height: 240px;
}
.emblem-svg { width: min(260px, 70%); }
.stem { stroke: var(--gold); stroke-width: 6; fill: none; stroke-linecap: round;
  stroke-dasharray: 220; stroke-dashoffset: 220; animation: grow 1.4s var(--ease) .3s forwards; }
.leaf { fill: var(--emerald); opacity: 0; transform-origin: center bottom; animation: sprout .6s var(--ease) 1.1s forwards; }
.leaf.r { animation-delay: 1.3s; }
.plug { fill: var(--gold); }
@keyframes grow { to { stroke-dashoffset: 0; } }
@keyframes sprout { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .stem { stroke-dashoffset: 0; animation: none; }
  .leaf { opacity: 1; animation: none; }
}

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.15fr .85fr; }
}

/* =========================================================
   Cards / grids
   ========================================================= */
.grid { display: grid; gap: 1.1rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2,1fr); } .grid-4 { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3,1fr); } .grid-4 { grid-template-columns: repeat(4,1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 1.5rem; box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card .ic {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--mist); color: var(--emerald); font-size: 1.3rem; margin-bottom: .9rem;
}
.card.accent .ic { background: var(--sand); color: var(--gold-600); }
.card p { color: var(--text-2); margin: 0; }

/* Numbered process steps (order carries meaning) */
.step .num {
  font-family: var(--font-lat); font-weight: 800; font-size: 1.1rem;
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--emerald); color: #fff; margin-bottom: .9rem;
}
.section-head { text-align: center; max-width: 60ch; margin-inline: auto; margin-bottom: 2.2rem; }
.section-head p { color: var(--text-2); }

/* CTA band */
.cta-band {
  background: var(--forest); color: var(--hero-text); border-radius: var(--r-lg);
  padding: clamp(2rem, 5vw, 3rem); text-align: center; position: relative; overflow: hidden;
}
.cta-band h2 { color: #fff; }
.cta-band::after {
  content:""; position:absolute; inset-block-end:-40%; inset-inline-start:-10%;
  width:45%; aspect-ratio:1; border-radius:50%;
  background: radial-gradient(circle, rgba(27,122,82,.5), transparent 60%);
}

/* =========================================================
   Forms / auth
   ========================================================= */
.auth-wrap { min-height: calc(100vh - 66px); display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card {
  width: 100%; max-width: 440px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: clamp(1.6rem, 4vw, 2.4rem); box-shadow: var(--shadow-md);
}
.auth-card h1 { font-size: 1.6rem; margin-bottom: .3rem; }
.auth-sub { color: var(--text-2); margin-bottom: 1.6rem; }
.field { margin-bottom: 1.05rem; }
.field label { display: block; font-weight: 600; margin-bottom: .4rem; font-size: .92rem; }
.field .req { color: #c0392b; }
.input, select.input, textarea.input {
  width: 100%; font: inherit; padding: .72rem .9rem; color: var(--text);
  background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--primary); box-shadow: var(--ring); }
.input.is-invalid { border-color: #c0392b; }
.field-error { color: #c0392b; font-size: .84rem; margin-top: .35rem; display: block; }
.field-hint { color: var(--text-2); font-size: .82rem; margin-top: .35rem; }
.checkline { display: flex; align-items: center; gap: .5rem; }
.form-foot { display:flex; justify-content:space-between; align-items:center; gap:.5rem; margin-block: 1rem; flex-wrap: wrap; }
.auth-alt { text-align: center; margin-top: 1.2rem; color: var(--text-2); }
.auth-alt a { color: var(--primary); font-weight: 700; }

/* role chooser */
.role-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: .6rem; }
.role-opt { position: relative; }
.role-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.role-opt span {
  display: grid; gap: .25rem; place-items: center; text-align: center;
  padding: .8rem .4rem; border: 1.5px solid var(--border); border-radius: var(--r-md);
  font-weight: 600; font-size: .9rem; transition: border-color .15s, background .15s;
}
.role-opt input:checked + span { border-color: var(--primary); background: var(--mist); }
.role-opt input:focus-visible + span { box-shadow: var(--ring); }

/* =========================================================
   Toasts
   ========================================================= */
.toast-region {
  position: fixed; inset-block-start: 78px; inset-inline-end: 1rem; z-index: 90;
  display: flex; flex-direction: column; gap: .6rem; max-width: 360px;
}
.toast {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-inline-start: 4px solid var(--primary); border-radius: var(--r-md);
  padding: .8rem 1rem; box-shadow: var(--shadow-md); animation: toastIn .25s var(--ease);
}
.toast.success { border-inline-start-color: var(--emerald); }
.toast.error   { border-inline-start-color: #c0392b; }
.toast.info    { border-inline-start-color: var(--gold-600); }
@keyframes toastIn { from { opacity:0; transform: translateY(-8px); } to { opacity:1; transform:none; } }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: var(--forest); color: var(--hero-text); margin-top: 3rem;
  padding-block: 2.5rem 1.5rem;
}
.footer-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer a { opacity: .85; } .site-footer a:hover { opacity: 1; color: var(--gold); }
.footer-bottom {
  margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.10);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: .85rem; opacity: .8;
}

/* =========================================================
   Error / maintenance pages
   ========================================================= */
.state-page {
  min-height: 80vh; display: grid; place-items: center; text-align: center; padding: 2rem;
}
.state-code { font-family: var(--font-lat); font-size: clamp(4rem, 14vw, 8rem); font-weight: 800; color: var(--primary); line-height: 1; }
.state-page p { color: var(--text-2); max-width: 44ch; margin-inline: auto; }

/* =====================================================================
   FEATURE LAYER (v0.2.0) — tables, badges, stats, timeline, admin shell
   ===================================================================== */
.page{padding:2.2rem 0 3rem}
.page-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin-bottom:1.4rem}
.page-head h1{margin:0;font-size:1.6rem;color:var(--forest)}
.muted{color:var(--text-2)}
.stack>*+*{margin-top:1rem}

/* stat cards */
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:1rem}
.stat{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md);padding:1.1rem 1.2rem;box-shadow:var(--shadow-sm)}
.stat .k{font-size:.82rem;color:var(--text-2);margin-bottom:.3rem}
.stat .v{font-size:1.7rem;font-weight:800;color:var(--forest);line-height:1}
.stat .v small{font-size:.9rem;font-weight:600;color:var(--text-2)}

/* badges */
.badge{display:inline-block;padding:.2rem .6rem;border-radius:var(--r-pill);font-size:.78rem;font-weight:700;line-height:1.6;white-space:nowrap}
.badge-info{background:#e6f0fb;color:#1d5fb0}
.badge-warn{background:#fdf3e0;color:#9a6a12}
.badge-gold{background:var(--gold-050);color:var(--gold-600)}
.badge-emerald{background:var(--mist);color:var(--emerald-700)}
.badge-muted{background:var(--surface-2);color:var(--text-2)}
.badge-critical{background:#fdecea;color:#b3261e}

/* tables */
.table-wrap{overflow-x:auto;border:1px solid var(--border);border-radius:var(--r-md);background:var(--surface)}
.table{width:100%;border-collapse:collapse;font-size:.92rem}
.table th,.table td{padding:.7rem .9rem;text-align:start;border-bottom:1px solid var(--border);vertical-align:middle}
.table th{background:var(--surface-2);font-weight:700;color:var(--text-2);font-size:.82rem;text-transform:uppercase;letter-spacing:.02em}
.table tr:last-child td{border-bottom:none}
.table tbody tr:hover{background:var(--surface-2)}

/* timeline (order status) */
.timeline{list-style:none;margin:0;padding:0}
.timeline li{position:relative;padding-inline-start:1.4rem;padding-bottom:1rem;border-inline-start:2px solid var(--border);margin-inline-start:.4rem}
.timeline li:last-child{border-inline-start-color:transparent;padding-bottom:0}
.timeline li::before{content:"";position:absolute;inset-inline-start:-7px;top:2px;width:12px;height:12px;border-radius:50%;background:var(--emerald);box-shadow:0 0 0 3px var(--mist)}
.timeline .t{font-size:.8rem;color:var(--text-2)}

/* chart card */
.chart-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md);padding:1.2rem;box-shadow:var(--shadow-sm)}
.chart-legend{display:flex;gap:1.2rem;flex-wrap:wrap;font-size:.85rem;color:var(--text-2);margin-top:.4rem}
.chart-legend span{display:inline-flex;align-items:center;gap:.4rem}
.dot{width:12px;height:3px;border-radius:2px;display:inline-block}

/* alert row */
.alert-row{display:flex;gap:.8rem;align-items:flex-start;padding:.8rem 0;border-bottom:1px solid var(--border)}
.alert-row:last-child{border-bottom:none}
.alert-dot{width:10px;height:10px;border-radius:50%;margin-top:.35rem;flex:0 0 auto}
.alert-dot.info{background:#1d5fb0}.alert-dot.warning{background:var(--gold-600)}.alert-dot.critical{background:#b3261e}

/* package cards */
.pkg-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:1.2rem}
.pkg{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);padding:1.4rem;box-shadow:var(--shadow-sm);display:flex;flex-direction:column}
.pkg h3{margin:.2rem 0 .1rem;color:var(--forest)}
.pkg .price{font-size:1.6rem;font-weight:800;color:var(--emerald-700);margin:.4rem 0}
.pkg .price s{font-size:1rem;color:var(--text-2);font-weight:500;margin-inline-start:.4rem}
.pkg ul{list-style:none;margin:.6rem 0 1rem;padding:0;font-size:.9rem}
.pkg ul li{padding:.25rem 0;border-bottom:1px dashed var(--border)}
.pkg .btn{margin-top:auto}

/* admin shell */
.admin-shell{display:grid;grid-template-columns:230px 1fr;min-height:100vh;background:var(--surface-2)}
.admin-side{background:var(--forest);color:#fff;padding:1.2rem .8rem;position:sticky;top:0;height:100vh;overflow:auto}
.admin-side .brand{color:#fff;margin-bottom:1.2rem}
.admin-side a{display:block;color:#dfeee6;text-decoration:none;padding:.6rem .8rem;border-radius:var(--r-sm);font-size:.94rem;margin-bottom:.15rem}
.admin-side a:hover{background:rgba(255,255,255,.08)}
.admin-side a.active{background:var(--emerald);color:#fff;font-weight:700}
.admin-main{padding:1.6rem 1.8rem;min-width:0}
.admin-topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.4rem;gap:1rem;flex-wrap:wrap}
@media(max-width:820px){.admin-shell{grid-template-columns:1fr}.admin-side{position:static;height:auto}}

/* forms grid */
.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1rem}
.inline-actions{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center}
.chatbot-note{background:var(--mist);border-inline-start:4px solid var(--emerald);padding:.9rem 1rem;border-radius:var(--r-sm);font-size:.9rem}
