@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

:root {
  --ink: #17312e;
  --muted: #667773;
  --pine: #153f3a;
  --pine-2: #21564f;
  --gold: #c89f62;
  --cream: #f7f3eb;
  --paper: #fffdf9;
  --line: #dfe6e2;
  --success: #20785e;
  --danger: #ad3d3d;
  --warning: #a66b18;
  --shadow: 0 18px 54px rgba(17, 54, 49, .12);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: 'DM Sans', sans-serif; color: var(--ink); background: var(--cream); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { color: var(--gold); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: .73rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.site-header { height: 78px; padding: 0 clamp(20px, 4vw, 64px); display: flex; align-items: center; justify-content: space-between; background: rgba(255,253,249,.9); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(21,63,58,.08); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 42px; height: 42px; }
.brand-name { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.18rem; line-height: 1; }
.brand-sub { color: var(--muted); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; margin-top: 5px; }
.header-actions { display: flex; align-items: center; gap: 10px; }

.btn { border: 0; border-radius: 999px; min-height: 46px; padding: 0 22px; cursor: pointer; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 9px; text-decoration: none; transition: transform .18s, box-shadow .18s, background .18s; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { cursor: not-allowed; opacity: .52; transform: none; }
.btn-primary { color: white; background: var(--pine); box-shadow: 0 10px 24px rgba(21,63,58,.2); }
.btn-primary:hover { background: var(--pine-2); }
.btn-gold { color: #1f302c; background: var(--gold); }
.btn-ghost { color: var(--pine); background: transparent; border: 1px solid var(--line); }
.btn-danger { color: white; background: var(--danger); }
.btn-small { min-height: 36px; padding: 0 15px; font-size: .82rem; }

.hero { min-height: calc(100vh - 78px); display: grid; grid-template-columns: minmax(0,1.2fr) minmax(340px,.8fr); }
.hero-copy { background: var(--pine); color: white; padding: clamp(60px, 8vw, 110px) clamp(28px, 8vw, 120px); display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.hero-copy::after { content: ''; position: absolute; width: 560px; height: 560px; border: 1px solid rgba(255,255,255,.11); border-radius: 50%; right: -250px; bottom: -240px; box-shadow: 0 0 0 65px rgba(255,255,255,.025), 0 0 0 130px rgba(255,255,255,.018); }
.hero h1 { font: 700 clamp(3rem, 6vw, 6.3rem)/.98 'Playfair Display', serif; letter-spacing: -.045em; max-width: 760px; margin: 18px 0 25px; }
.hero-lead { color: rgba(255,255,255,.72); max-width: 600px; font-size: clamp(1rem, 1.4vw, 1.22rem); line-height: 1.7; }
.flow { display: flex; gap: 10px; align-items: center; margin-top: 40px; flex-wrap: wrap; }
.flow-step { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; }
.flow-step span { width: 29px; height: 29px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); color: var(--gold); }
.flow-arrow { color: rgba(255,255,255,.32); }
.hero-auth { padding: clamp(35px, 6vw, 92px); display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 85% 10%, #e7ddca 0, transparent 35%), var(--cream); }
.auth-card { width: 100%; max-width: 470px; background: var(--paper); border: 1px solid rgba(21,63,58,.09); border-radius: 28px; box-shadow: var(--shadow); padding: clamp(27px, 4vw, 46px); }
.auth-card h2 { font: 700 2rem/1.1 'Playfair Display', serif; margin: 8px 0 9px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: #edf0ec; padding: 4px; border-radius: 999px; margin: 28px 0 24px; }
.tab { border: 0; background: transparent; min-height: 41px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 700; }
.tab.active { background: var(--paper); color: var(--pine); box-shadow: 0 3px 12px rgba(21,63,58,.08); }
.form-group { margin-bottom: 18px; }
label { display: block; font-size: .82rem; font-weight: 700; margin-bottom: 8px; }
input, select, textarea { width: 100%; border: 1px solid #ccd7d2; border-radius: 13px; background: white; min-height: 49px; padding: 0 14px; color: var(--ink); outline: none; }
textarea { padding-top: 13px; min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--pine-2); box-shadow: 0 0 0 3px rgba(33,86,79,.11); }
.form-submit { width: 100%; margin-top: 6px; }
.form-note { font-size: .78rem; color: var(--muted); line-height: 1.55; margin-top: 18px; }
.message { border-radius: 12px; padding: 12px 14px; font-size: .86rem; margin: 12px 0; background: #edf5f2; color: var(--success); }
.message.error { background: #faeaea; color: var(--danger); }
.mobile-charge-summary { display: none; }
.secure-row { display: flex; justify-content: center; gap: 18px; margin-top: 18px; color: var(--muted); font-size: .72rem; font-weight: 600; }
.secure-row span::before { content: '✓'; color: var(--success); margin-right: 5px; }

.app-shell { min-height: 100vh; background: #f3f5f2; }
.app-main { max-width: 1260px; margin: 0 auto; padding: 40px clamp(18px, 4vw, 48px) 80px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 28px; }
.page-heading h1 { font: 700 clamp(2.1rem, 4vw, 3.5rem)/1.04 'Playfair Display', serif; margin: 8px 0 0; letter-spacing: -.03em; }
.page-intro { color: var(--muted); margin: 10px 0 0; line-height: 1.5; }
.status-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #e6efe9; color: var(--success); }
.status-chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(32,120,94,.12); }
.status-chip.offline { color: var(--danger); background: #f8e9e7; }
.charge-stepper { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; background: white; border: 1px solid rgba(21,63,58,.08); border-radius: 18px; padding: 14px 20px; margin-bottom: 20px; box-shadow: 0 8px 28px rgba(21,63,58,.045); }
.journey-step { display: grid; grid-template-columns: 34px auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; color: #8a9995; }
.journey-step > span { grid-row: 1/3; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #edf0ee; font-weight: 800; }
.journey-step small { font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; }
.journey-step strong { font-size: .82rem; white-space: nowrap; }
.journey-step.active { color: var(--pine); }
.journey-step.active > span { color: white; background: var(--pine); box-shadow: 0 0 0 5px rgba(21,63,58,.09); }
.journey-step.complete { color: var(--success); }
.journey-step.complete > span { color: white; background: var(--success); }
.journey-line { height: 2px; background: #e4e9e6; margin-inline: 14px; }
.grid { display: grid; gap: 20px; }
.dashboard-grid { grid-template-columns: minmax(0,1.35fr) minmax(310px,.65fr); }
.dashboard-grid > * { min-width: 0; }
.card { background: white; border: 1px solid rgba(21,63,58,.08); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); box-shadow: 0 10px 35px rgba(21,63,58,.055); }
.card-title { display: flex; justify-content: space-between; gap: 15px; align-items: center; margin-bottom: 22px; }
.card-title h2 { font: 700 1.45rem 'Playfair Display', serif; margin: 0; }
.checkout-title { align-items: flex-start; }
.checkout-title .eyebrow { margin-bottom: 6px; }
.secure-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 7px 10px; color: var(--success); background: #e7f3ed; font-size: .7rem; font-weight: 800; }
.secure-badge::before { content: '✓'; margin-right: 5px; }
.charger-visual { min-height: 330px; background: linear-gradient(145deg, #153f3a, #0f2f2c); border-radius: 19px; color: white; padding: clamp(24px,4vw,42px); position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; }
.charger-visual::after { content: ''; width: 260px; height: 260px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; position: absolute; right: -60px; bottom: -115px; box-shadow: 0 0 0 45px rgba(255,255,255,.025), 0 0 0 90px rgba(255,255,255,.018); }
.charger-name { font: 600 2rem 'Playfair Display', serif; }
.charger-id { color: rgba(255,255,255,.58); font-size: .8rem; letter-spacing: .1em; margin-top: 7px; }
.session-readouts { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; position: relative; z-index: 1; }
.readout { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 15px; }
.readout-label { color: rgba(255,255,255,.55); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.readout-value { font-weight: 700; font-size: 1.2rem; margin-top: 7px; }
.charger-actions { display: flex; gap: 12px; margin-top: 18px; }
.charger-actions .btn { flex: 1; }
.start-charge-btn { min-height: 54px; font-size: 1rem; }
.charger-guidance { display: flex; gap: 9px; flex-direction: column; margin-top: 16px; border-radius: 14px; padding: 15px 16px; background: #edf5f2; color: var(--pine); font-size: .82rem; line-height: 1.45; }
.charger-guidance strong { font-size: .88rem; }
.charger-guidance span { color: var(--muted); }
.entitlement { border-left: 4px solid var(--gold); background: #fbf7ef; padding: 17px 18px; border-radius: 0 14px 14px 0; margin-bottom: 20px; }
.entitlement strong { display: block; margin-bottom: 5px; }
.packages { display: grid; gap: 11px; }
.package { border: 1px solid var(--line); border-radius: 15px; padding: 15px 16px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; cursor: pointer; transition: border .18s, background .18s, transform .18s; }
.package:hover { transform: translateY(-1px); border-color: #9eb7ad; }
.package.selected { border-color: var(--pine); background: #f1f7f4; box-shadow: 0 0 0 2px rgba(21,63,58,.08); }
.package input { width: 18px; min-height: 18px; accent-color: var(--pine); }
.package-name { display: block; font-weight: 700; }
.package-detail { display: block; color: var(--muted); font-size: .76rem; margin-top: 3px; }
.package-price { font-weight: 700; }
.pay-btn { width: 100%; margin-top: 17px; }
.checkout-note { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); background: #f5f7f5; border-radius: 12px; padding: 12px 13px; margin-top: 14px; font-size: .75rem; line-height: 1.45; }
.checkout-note > span:first-child { color: var(--success); font-weight: 800; }
.code-disclosure { margin-top: 17px; border-top: 1px solid var(--line); padding-top: 15px; }
.code-disclosure summary { cursor: pointer; text-align: center; color: var(--pine); font-size: .8rem; font-weight: 700; list-style: none; }
.code-disclosure summary::-webkit-details-marker { display: none; }
.code-disclosure summary::before { content: '+'; margin-right: 7px; }
.code-disclosure[open] summary::before { content: '−'; }
.code-disclosure .code-row { margin-top: 13px; }
.divider { display: flex; align-items: center; gap: 12px; color: #8a9995; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; margin: 22px 0; }
.divider::before, .divider::after { content: ''; height: 1px; background: var(--line); flex: 1; }
.code-row { display: flex; gap: 9px; }
.code-row input { min-width: 0; }
.code-row .btn { flex: 0 0 auto; }
.history { grid-column: 1/-1; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--line); }
td { padding: 15px 13px; border-bottom: 1px solid #edf0ee; font-size: .86rem; }
.empty { color: var(--muted); padding: 26px 0; text-align: center; }

.admin-shell .site-header { background: #132e2b; color: white; border: 0; position: static; }
.admin-shell .brand-sub { color: rgba(255,255,255,.55); }
.admin-shell .btn-ghost { color: white; border-color: rgba(255,255,255,.22); }
.admin-login { min-height: calc(100vh - 78px); display: grid; place-items: center; padding: 30px; background: radial-gradient(circle at 20% 10%, #e7ddca 0, transparent 28%), var(--cream); }
.admin-login .auth-card { max-width: 440px; }
.stats-grid { grid-template-columns: repeat(4,1fr); margin-bottom: 20px; }
.stat-card { padding: 23px; }
.stat-value { font: 700 2rem 'Playfair Display', serif; margin: 8px 0 3px; }
.stat-label { color: var(--muted); font-size: .8rem; }
.weekly-card { margin-bottom: 20px; }
.weekly-chart { height: 190px; display: grid; grid-template-columns: repeat(8,1fr); gap: clamp(7px,2vw,22px); align-items: end; }
.week-column { height: 100%; display: grid; grid-template-rows: 25px 1fr 24px; gap: 5px; text-align: center; min-width: 0; }
.week-value { font-weight: 700; font-size: .8rem; }
.week-bar { height: 100%; border-radius: 8px; background: #edf1ee; position: relative; overflow: hidden; }
.week-bar span { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 8px; background: linear-gradient(180deg,var(--gold),#ad8041); min-height: 4px; }
.week-bar .h-1 { height: 10%; }.week-bar .h-2 { height: 20%; }.week-bar .h-3 { height: 30%; }.week-bar .h-4 { height: 40%; }.week-bar .h-5 { height: 50%; }
.week-bar .h-6 { height: 60%; }.week-bar .h-7 { height: 70%; }.week-bar .h-8 { height: 80%; }.week-bar .h-9 { height: 90%; }.week-bar .h-10 { height: 100%; }
.week-label { color: var(--muted); font-size: .68rem; white-space: nowrap; }
.admin-grid { grid-template-columns: minmax(330px,.7fr) minmax(0,1.3fr); align-items: start; }
.charger-admin { background: var(--pine); color: white; }
.charger-admin .muted { color: rgba(255,255,255,.58); }
.data-list { display: grid; gap: 12px; margin-top: 24px; }
.data-item { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.12); }
.admin-tabs { display: flex; gap: 7px; flex-wrap: wrap; margin: 28px 0 18px; }
.admin-tab { border: 1px solid var(--line); background: white; border-radius: 999px; padding: 9px 15px; cursor: pointer; font-weight: 700; color: var(--muted); }
.admin-tab.active { color: white; background: var(--pine); border-color: var(--pine); }
.code-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.code-result { background: #edf5f2; border: 1px dashed #8fb7a8; border-radius: 14px; padding: 18px; margin-top: 17px; }
.code-result strong { font-size: 1.25rem; letter-spacing: .06em; }
.pill { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: .71rem; font-weight: 700; text-transform: capitalize; background: #edf3f0; color: var(--pine); }
.pill.failed, .pill.expired, .pill.inactive { color: var(--danger); background: #f9e9e8; }
.pill.paid, .pill.charging, .pill.active { color: var(--success); background: #e7f3ed; }

.toast { position: fixed; right: 22px; bottom: 22px; max-width: 420px; z-index: 50; border-radius: 14px; padding: 14px 18px; color: white; background: var(--pine); box-shadow: var(--shadow); animation: toast-in .22s ease-out; }
.toast.error { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.spinner { width: 17px; height: 17px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .65s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { min-height: 560px; }
  .hero-auth { padding-block: 60px; }
  .dashboard-grid, .admin-grid { grid-template-columns: minmax(0,1fr); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .site-header { height: 68px; padding-inline: 16px; }
  .brand img { width: 36px; height: 36px; }
  .brand-sub { display: none; }
  .hero { min-height: auto; }
  .hero-auth { order: 1; align-items: flex-start; padding: 18px 14px 28px; background: radial-gradient(circle at 90% 0, #e7ddca 0, transparent 40%), var(--cream); }
  .hero-copy { order: 2; min-height: auto; padding: 45px 22px 52px; }
  .hero h1 { font-size: 2.65rem; max-width: 360px; margin-block: 13px 18px; }
  .hero-lead { font-size: .94rem; line-height: 1.6; }
  .auth-card { border-radius: 21px; padding: 22px 20px; box-shadow: 0 12px 35px rgba(17,54,49,.1); }
  .auth-card h2 { font-size: 1.75rem; }
  .mobile-charge-summary { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; margin: -5px -3px 22px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
  .mobile-charge-summary strong, .mobile-charge-summary small { display: block; }
  .mobile-charge-summary strong { font-size: .84rem; }
  .mobile-charge-summary small { color: var(--muted); margin-top: 3px; font-size: .69rem; }
  .mobile-charge-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--pine); }
  .availability-dot { color: var(--success); background: #e7f3ed; border-radius: 999px; padding: 6px 8px; font-size: .62rem; font-weight: 800; }
  .tabs { margin: 22px 0 20px; }
  input, select, textarea { min-height: 52px; font-size: 16px; }
  .form-submit { min-height: 55px; }
  .secure-row { gap: 10px; flex-wrap: wrap; }
  .flow-arrow { display: none; }
  .flow { display: grid; }
  .page-heading { align-items: start; flex-direction: column; }
  .page-heading h1 { font-size: 2.15rem; }
  .page-heading .status-chip { align-self: flex-start; }
  .page-intro { font-size: .86rem; }
  .app-main { padding: 22px 13px 64px; }
  .charge-stepper { grid-template-columns: 1fr 15px 1fr 15px 1fr; padding: 12px 10px; border-radius: 16px; }
  .journey-step { display: flex; flex-direction: column; gap: 5px; text-align: center; }
  .journey-step > span { width: 30px; height: 30px; font-size: .75rem; }
  .journey-step small { display: none; }
  .journey-step strong { white-space: normal; font-size: .67rem; line-height: 1.15; }
  .journey-line { margin: 0; }
  .dashboard-grid { gap: 14px; }
  .checkout-card { order: 1; }
  .charger-card { order: 2; }
  .history { order: 3; }
  .has-entitlement .charger-card { order: 1; }
  .has-entitlement .checkout-card { order: 2; }
  .card { border-radius: 18px; padding: 19px 17px; }
  .card-title { margin-bottom: 17px; }
  .checkout-title h2 { font-size: 1.35rem; }
  .packages { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .package { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-height: 132px; padding: 15px; }
  .package input { position: absolute; top: 13px; right: 13px; width: 18px; min-height: 18px; }
  .package-copy { padding-right: 17px; }
  .package-name { font-size: .9rem; }
  .package-detail { line-height: 1.3; }
  .package-price { margin-top: auto; font-size: 1.35rem; color: var(--pine); }
  .pay-btn { min-height: 57px; font-size: 1rem; margin-top: 14px; box-shadow: 0 12px 26px rgba(21,63,58,.22); }
  .charger-visual { min-height: 275px; padding: 24px 18px; }
  .charger-name { font-size: 1.65rem; }
  .charger-id { font-size: .65rem; line-height: 1.45; }
  .session-readouts { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
  .readout { padding: 11px 8px; min-width: 0; }
  .readout-label { font-size: .56rem; }
  .readout-value { font-size: .88rem; overflow-wrap: anywhere; }
  .charger-actions { flex-direction: column; }
  .charger-actions .btn { min-height: 55px; }
  .charger-guidance { margin-top: 13px; }
  .stats-grid { grid-template-columns: 1fr; }
  .code-form-grid { grid-template-columns: 1fr; }
  .code-row { flex-direction: column; }
  .code-row .btn { width: 100%; }
  .header-user { display: none; }
}
