/* X4 Energy — Customer polish (mobile-first) — 20261102-custpolish
   Shared by: index, register, login, verify-email, set-password, portal/, customer-pay (/c/<EVSE>).
   Styling only. Linked LAST on each page. Not used by admin/. */
:root {
  --sp-1: .25rem; --sp-2: .5rem; --sp-3: .75rem; --sp-4: 1rem; --sp-5: 1.25rem; --sp-6: 1.5rem; --sp-8: 2rem;
  --tap: 48px;
  --radius-lg: 16px;
  --focus: 0 0 0 3px #fff, 0 0 0 5px #1f8a1f;
  --ok-ink: #17401a; --ok-bg: #eaf8ea; --ok-line: #b9e3b9;
  --shadow-card: 0 1px 2px rgba(17,17,17,.04), 0 8px 24px rgba(17,17,17,.06);
}

/* ---------- Base / no horizontal scroll / safe areas ---------- */
html, body { overflow-x: clip; max-width: 100%; }
body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; padding-bottom: env(safe-area-inset-bottom); }
.site-header, .app-bar { padding-top: env(safe-area-inset-top); }
.site-header .wrap, .app-bar .wrap, .site-footer .wrap, main .wrap {
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
}
h1, h2, h3 { text-wrap: balance; overflow-wrap: anywhere; hyphens: auto; }
p, li { overflow-wrap: break-word; }
code { overflow-wrap: anywhere; }
header [hidden], .header-nav [hidden] { display: none !important; }

/* ---------- Focus ---------- */
a:focus-visible, button:focus-visible, .btn:focus-visible, summary:focus-visible,
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible {
  outline: none; box-shadow: var(--focus); border-radius: 10px;
}
.field-input:focus, .field-input:focus-visible {
  outline: none; border-color: #2fa52f; background: #fff;
  box-shadow: 0 0 0 4px rgba(57,201,58,.22);
}
.field.has-error .field-input:focus { box-shadow: 0 0 0 4px rgba(198,40,40,.18); }

/* ---------- Buttons: 48px, text optically centered ---------- */
.btn {
  min-height: var(--tap);
  padding: 0 1.25rem;
  line-height: 1.2;
  text-align: center;
  vertical-align: middle;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border-radius: 12px;
  font-size: 1rem;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn > * { line-height: inherit; }
.btn-ghost { background: #fff; border-color: #d9dcd5; }
.btn-ghost:hover { background: #f4f6f2; }
.btn-primary { box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 4px 12px rgba(57,201,58,.22); }
.btn-sm { min-height: 40px; padding: 0 .9rem; }
.auth-submit, .x4-stack .btn { width: 100%; min-height: 52px; font-size: 1.05rem; }
.x4-alert-actions .btn, .x4-alert .btn { min-height: 44px; padding: 0 1rem; }

/* ---------- Header / nav ---------- */
.header-inner { gap: var(--sp-3); }
.nav-toggle { min-height: 44px; align-items: center; }
.site-nav .btn { min-height: var(--tap); }
.header-nav { display: flex; align-items: center; gap: var(--sp-2); }
.header-nav .btn { min-height: 44px; padding: 0 1rem; font-size: .95rem; }

/* ---------- Inputs ≥16px (no iOS zoom), comfy height ---------- */
.field-input, input[type="email"], input[type="text"], input[type="password"], input[type="tel"], select, textarea {
  font-size: max(16px, 1rem);
}
.field-input { min-height: 50px; border-radius: 12px; border-color: #d9dcd5; background: #fbfbfa; }
.field-input::placeholder { color: #8a8f86; opacity: 1; }
.field { gap: .4rem; }
.field-label { color: var(--ink); line-height: 1.3; }
.field-hint { color: #4a4f47; }

/* checkboxes: big tap target */
.field-check { display: flex; align-items: flex-start; gap: .75rem; min-height: 44px; padding: .35rem 0; cursor: pointer; line-height: 1.4; }
.field-check input[type="checkbox"] { width: 22px; height: 22px; margin: .05rem 0 0; flex: 0 0 auto; accent-color: #2fa52f; cursor: pointer; }
.auth-form .field-check input { width: 22px; height: 22px; }

/* ---------- Auth pages (register / login / verify / set-password) ---------- */
.auth-main .auth-section { padding: var(--sp-5) 0 var(--sp-8); }
.auth-wrap { max-width: 34rem; }
.auth-main .eyebrow { margin: 0 0 var(--sp-2); }
.auth-main h1 { margin: 0 0 var(--sp-2); font-size: clamp(1.75rem, 7vw, 2.4rem); line-height: 1.12; letter-spacing: -.02em; }
.auth-main .section-lead { margin: 0 0 var(--sp-5); color: #3f443c; line-height: 1.5; }
.auth-form.surface-panel {
  border-radius: var(--radius-lg); border: 1px solid #e4e6e1; box-shadow: var(--shadow-card);
  padding: var(--sp-5); gap: var(--sp-5); margin: 0 0 var(--sp-5);
}
.auth-steps {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); margin: 0 0 var(--sp-5);
}
.auth-steps li {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 44px; padding: .4rem .5rem; border-radius: 999px; line-height: 1.2; font-weight: 600;
}
.auth-steps li.is-active { background: #2fa52f; color: #fff; }
.auth-steps li.is-done { background: var(--ok-bg); color: var(--ok-ink); }
.auth-main .fineprint { line-height: 1.6; }
.auth-main .fineprint a, .auth-main .inline-link { text-underline-offset: 3px; }
#footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem .75rem; }
#footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
#login-form > .fineprint a { display: inline-flex; align-items: center; min-height: 44px; }
.auth-main + p, main > p:last-child { line-height: 1.6; }
#mfa-form .btn-ghost { width: 100%; }
.x4-alert { border-radius: 12px; font-size: 1rem; }
.x4-alert-text { line-height: 1.5; }
.x4-tips { border-radius: 12px; }
.auth-success-icon { display: grid; place-items: center; }

@media (max-width: 480px) {
  .auth-form.surface-panel { padding: var(--sp-4) !important; gap: var(--sp-4); border-radius: 14px; }
  .auth-steps li { font-size: .8rem; padding: .35rem .3rem; }
  .auth-main .auth-section { padding-top: var(--sp-4); }
}

/* ---------- Home ---------- */
.hero-line:first-child::after { display: none; }   /* no green accent on slogan */
.hero-line:first-child { padding-bottom: 0; margin-bottom: 0; }
.hero-slogan { color: var(--ink); font-weight: 600; letter-spacing: .01em; }
.hero-actions { gap: var(--sp-3); }
.hero-actions .btn { min-height: var(--tap); }
@media (max-width: 639px) {
  .hero-actions .btn { width: 100%; }
}

/* ---------- Portal ---------- */
.app-bar-inner { gap: var(--sp-3); }
.app-bar-inner > div { min-width: 0; }
.app-bar-user { min-width: 0; max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-bar .btn { min-height: 44px; padding: 0 1rem; }
.app-main { padding: var(--sp-4) 0 var(--sp-8); }
.cp-stack { display: grid; gap: var(--sp-4); max-width: 44rem; margin: 0 auto; }
.cp-card {
  background: var(--surface); border: 1px solid #e4e6e1; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: var(--sp-5);
}
.cp-card > h2 { margin: 0 0 var(--sp-3); font-size: 1.2rem; line-height: 1.25; }
.cp-welcome h1 { margin: 0; font-size: clamp(1.6rem, 6.5vw, 2.1rem); line-height: 1.15; letter-spacing: -.02em; }
.cp-slogan { margin: var(--sp-1) 0 0; color: var(--muted); font-weight: 600; font-size: 1.02rem; letter-spacing: .01em; }
.cp-rows { list-style: none; margin: var(--sp-4) 0 0; padding: 0; border-top: 1px solid var(--line); }
.cp-rows li { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3);
  min-height: 48px; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.cp-rows li:last-child { border-bottom: 0; padding-bottom: 0; }
.cp-k { color: #4a4f47; font-size: .95rem; flex: 0 0 auto; }
.cp-v { font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.cp-badges { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4); }
.cp-badge { display: inline-flex; align-items: center; gap: .35rem; min-height: 30px; padding: 0 .75rem; border-radius: 999px;
  font-size: .88rem; font-weight: 700; line-height: 1; background: #f0f1ee; color: #3a3a3a; border: 1px solid #e0e2dd; }
.cp-badge svg { width: 14px; height: 14px; flex: 0 0 auto; }
.cp-badge.is-ok { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-line); }
.cp-badge.is-warn { background: #fff8ea; color: #6b4100; border-color: #f0d49b; }
.cp-lead { margin: 0 0 var(--sp-4); color: #4a4f47; font-size: .95rem; line-height: 1.5; }
.cp-actions { display: grid; gap: var(--sp-3); margin-top: var(--sp-4); }
.cp-actions .btn, #pm-form .btn { width: 100%; min-height: 52px; font-size: 1.02rem; }
#pm-msg:empty { display: none; }
#pm-msg { margin: var(--sp-3) 0 0; padding: .65rem .85rem; border-radius: 10px; background: #f4f6f2; color: #2d322a; font-size: .95rem; }
#pm-form { margin-top: var(--sp-4) !important; }
#pm-element { min-height: 120px; }
.cp-setting { display: flex; align-items: center; gap: .85rem; min-height: 52px; padding: .5rem 0; cursor: pointer; font-size: 1rem; line-height: 1.35; }
.cp-setting input[type="checkbox"] { width: 22px; height: 22px; accent-color: #2fa52f; flex: 0 0 auto; margin: 0; }
.cp-setting small { display: block; color: #5b6058; font-size: .86rem; }
.cp-foot { text-align: center; margin: var(--sp-2) 0 0; }
.cp-foot a { display: inline-flex; align-items: center; min-height: 44px; }

/* saved card tiles */
.cp-cards { display: grid; gap: var(--sp-3); margin: 0 0 var(--sp-3); }
.cp-cards:empty { display: none; }
.cp-paycard {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: .9rem;
  width: 100%; max-width: 22rem; aspect-ratio: 1.586 / 1; min-height: 11rem;
  padding: 1.1rem 1.2rem; border-radius: 18px; color: #fff; overflow: hidden; isolation: isolate;
  background: linear-gradient(135deg, #1b1f24 0%, #2c333b 55%, #1a2a1b 100%);
  box-shadow: 0 12px 28px rgba(17,17,17,.2);
}
.cp-paycard::after { content: ""; position: absolute; right: -50px; top: -70px; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.16), transparent 70%); z-index: -1; }
.cp-paycard.brand-visa { background: linear-gradient(135deg, #0f1f66 0%, #1a3aa8 60%, #0f1f5c 100%); }
.cp-paycard.brand-mastercard, .cp-paycard.brand-maestro { background: linear-gradient(135deg, #1d1d1f 0%, #3a2a1c 60%, #1d1d1f 100%); }
.cp-paycard.brand-amex { background: linear-gradient(135deg, #0b5f8a 0%, #1a86c0 60%, #0b5f8a 100%); }
.cp-paycard-top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.cp-paycard-logo { width: 60px; height: 40px; border-radius: 8px; background: #fff; display: grid; place-items: center; overflow: hidden; flex: 0 0 auto; }
.cp-paycard-logo svg { width: 52px; height: 33px; display: block; }
.cp-paycard-top .cp-badge { min-height: 28px; font-size: .82rem; background: #e9f9e9; color: #14501a; border-color: transparent; }
.cp-paycard-top .cp-badge.is-warn { background: #fff1d6; color: #6b4100; }
.cp-paycard-num { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: clamp(1.05rem, 5.4vw, 1.3rem);
  letter-spacing: .06em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cp-paycard-num b { font-weight: 700; }
.cp-paycard-meta { display: flex; justify-content: space-between; align-items: flex-end; gap: .5rem .9rem; flex-wrap: wrap;
  font-size: .9rem; color: rgba(255,255,255,.88); line-height: 1.25; }
.cp-paycard-exp { font-variant-numeric: tabular-nums; font-weight: 600; color: #fff; }
.cp-paycard-exp small { font-weight: 400; color: rgba(255,255,255,.75); font-size: .78rem; margin-right: .2rem; }
@media (max-width: 340px) { .cp-paycard { aspect-ratio: auto; } }
@media (min-width: 720px) {
  .cp-card { padding: var(--sp-6); }
  .cp-actions { grid-template-columns: max-content; }
  .cp-actions .btn, #pm-form .btn { width: auto; min-width: 16rem; }
}

/* ---------- customer-pay (/c/<EVSE>) — styling only ---------- */
#step-choose .form-actions { display: grid !important; grid-template-columns: 1fr; gap: var(--sp-3) !important; margin: 0; }
#step-choose .form-actions .btn { width: 100%; min-height: 52px; font-size: 1.05rem; }
@media (min-width: 560px) {
  #step-choose .form-actions { grid-template-columns: 1fr 1fr; }
}
.auth-main .panel-meta { margin: 0 0 var(--sp-2); text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; font-weight: 700; color: #4a4f47; }
#page-lead { margin: 0 0 var(--sp-5); line-height: 1.5; }
.auth-main .surface-panel { border-radius: var(--radius-lg); }
#step-pay .x4-paycard { border-radius: var(--radius-lg); }
#step-pay .x4-paybtn { min-height: 58px; padding: 0 1rem; line-height: 1.2; }
#step-pay .x4-paybtn .x4-lbl { line-height: 1.2; }
#step-pay .x4-back { min-height: 40px; display: inline-flex; align-items: center; padding: 0 .9rem; }
#step-session .auth-form { margin: 0 0 var(--sp-3); }
#step-session .auth-form .btn { width: 100%; min-height: 52px; }
.x4-countdown { border-radius: 12px; min-height: 44px; }
@media (max-width: 400px) {
  #step-pay .x4-paybtn { font-size: 1.02rem; }
  .x4-paycard-head { align-items: center; }
}

/* ---------- Footer ---------- */
.footer-nav a { display: inline-flex; align-items: center; min-height: 44px; }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}

/* ---------- Home: live status icons (20261102-custpolish2) ---------- */
.evse-status-list { gap: .55rem; }
.evse-status-row { display: grid !important; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .75rem;
  min-height: 56px; padding: .55rem .75rem; border-radius: 12px; }
.evse-ico-wrap { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: #f0f1ee; color: #6b7068; }
.evse-ico { width: 26px; height: 26px; display: block; }
.evse-status-row .evse-id { font-size: .9rem; overflow-wrap: anywhere; word-break: normal; }
.evse-badge { min-height: 28px; padding: 0 .7rem; font-size: .82rem; }
.evse-row--frei .evse-ico-wrap { background: #e6f7e6; color: #1f8a1f; }
.evse-badge--frei { background: #e6f7e6; color: #136b1b; }
.evse-row--belegt .evse-ico-wrap { background: #fde8e8; color: #c62828; }
.evse-badge--belegt { background: #fde8e8; color: #a51d1d; }
.evse-row--belegt .evse-ico-wrap { animation: evsePulse 2.2s ease-in-out infinite; }
.evse-row--offline .evse-ico-wrap, .evse-row--unbekannt .evse-ico-wrap { background: #f0f1ee; color: #7a7f77; }
.evse-badge--offline, .evse-badge--unbekannt { background: #f0f1ee; color: #4f544c; }
.evse-row--stoerung .evse-ico-wrap { background: #fff1d6; color: #b36b00; }
.evse-badge--stoerung { background: #fff1d6; color: #7a4a00; }
@keyframes evsePulse { 0%,100% { box-shadow: 0 0 0 0 rgba(198,40,40,.35); } 50% { box-shadow: 0 0 0 6px rgba(198,40,40,0); } }
@media (prefers-reduced-motion: reduce) { .evse-row--belegt .evse-ico-wrap { animation: none; } }
.evse-status-row:has(.evse-badge--loading) { grid-template-columns: minmax(0, 1fr) auto; }

/* ---------- Home: So funktioniert's ---------- */
.how-steps { list-style: none; margin: var(--sp-4) 0 0; padding: 0; display: grid; gap: var(--sp-3); counter-reset: none; }
.how-step { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: .9rem; align-items: start;
  padding: 1rem; background: var(--surface); border: 1px solid #e4e6e1; border-radius: 14px; box-shadow: var(--shadow-card); }
.how-ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: #111; color: #39c93a; }
.how-ico svg { width: 26px; height: 26px; }
.how-title { margin: .1rem 0 .25rem; font-size: 1.08rem; line-height: 1.3; }
.how-num { color: #6b7068; font-variant-numeric: tabular-nums; }
.how-body p { margin: 0; color: #3f443c; line-height: 1.5; }
.how-figure { margin: .85rem 0 0; border: 1px solid #e4e6e1; border-radius: 12px; overflow: hidden; background: #f4f5f2; }
.how-figure img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.how-figure figcaption { padding: .55rem .8rem; font-size: .88rem; color: #4f544c; border-top: 1px solid #e4e6e1; }
.how-figure-ph { display: none; }
.how-cap-missing { display: none; }
.how-figure.is-missing img { display: none; }
.how-figure.is-missing .how-figure-ph { display: grid; place-items: center; aspect-ratio: 16 / 9; color: #9aa095;
  background: repeating-linear-gradient(135deg, #f4f5f2 0 12px, #eeefeb 12px 24px); }
.how-figure.is-missing .how-figure-ph svg { width: 44px; height: 44px; }
.how-figure.is-missing .how-cap-missing { display: inline; }
.how-figure.is-missing .how-cap-ok { display: none; }
@media (min-width: 900px) { .how-figure { max-width: 26rem; } }
/* evse rows: keep the ID on one line */
.evse-status-row .evse-id { white-space: nowrap; overflow-wrap: normal; overflow: hidden; text-overflow: ellipsis; border: 0; background: none; padding: 0; font-size: .92rem; font-weight: 600; }
@media (max-width: 440px) {
  .evse-status-row { grid-template-columns: auto minmax(0, 1fr) !important; row-gap: .3rem; }
  .evse-status-row .evse-ico-wrap { grid-row: span 2; }
  .evse-status-row .evse-badge { justify-self: start; }
}
/* brand tile colours */
.cp-paycard.brand-maestro { background: linear-gradient(135deg, #0b2a4a 0%, #1b4f86 60%, #3a2f6e 100%); }
.cp-paycard.brand-amex { background: linear-gradient(135deg, #00579c 0%, #016fd0 55%, #0a4f8f 100%); }
.cp-paycard.brand-girocard { background: linear-gradient(135deg, #003b6f 0%, #0057a0 60%, #00305c 100%); }
.cp-paycard.brand-discover { background: linear-gradient(135deg, #2a2420 0%, #4a3020 55%, #b5591a 100%); }
.cp-paycard.brand-diners { background: linear-gradient(135deg, #0b3a5c 0%, #0079be 60%, #0b3a5c 100%); }
.cp-paycard.brand-jcb { background: linear-gradient(135deg, #0e3c78 0%, #0f6a5a 60%, #0e3c78 100%); }
.cp-paycard.brand-unionpay { background: linear-gradient(135deg, #00344f 0%, #006a74 55%, #7a1424 100%); }
.cp-paycard.brand-cartes_bancaires { background: linear-gradient(135deg, #003f73 0%, #00589f 55%, #1d84c2 100%); }
.cp-paycard.brand-eftpos_au { background: linear-gradient(135deg, #111 0%, #2b2b2b 60%, #0f3b2a 100%); }
.cp-paycard.brand-unknown { background: linear-gradient(135deg, #2c333b 0%, #474f58 60%, #2c333b 100%); }
