/* ============================================================
   form.css — Ewings Papers · Redesigned UI
   Google Forms-inspired, elevated with Poppins + refined
   interactions, cards, focus states, and motion.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --theme-accent:      #673AB7;
  --theme-accent-rgb:  103,58,183;
  --theme-header-bg:   #673AB7;
  --theme-header-text: #ffffff;

  /* Page background — JS sets --bg to the theme-specific solid colour */
  --bg:           #f3eeff;
  --bg-solid:     #f3eeff;

  --surface:      #ffffff;
  --surface2:     #fafafa;
  --border:       rgba(0,0,0,0.08);
  --border-md:    rgba(0,0,0,0.14);
  --text:         #202124;
  --text-muted:   #5f6368;
  --text-hint:    #bbb;
  --input-bg:     transparent;
  --error-color:  #d93025;
  --error-bg:     #fce8e6;
  --success-color:#188038;
  --success-bg:   #e6f4ea;

  --radius-sm:    4px;
  --radius-md:    8px;
  --radius-lg:    12px;
  --radius-xl:    16px;
  --topbar-h:     56px;
  --card-shadow:  0 2px 6px 2px rgba(60,64,67,0.10), 0 1px 2px 0 rgba(60,64,67,0.10);
  --card-shadow-hover: 0 4px 12px 4px rgba(60,64,67,0.14), 0 2px 4px 0 rgba(60,64,67,0.10);
  --font: 'Poppins', 'Google Sans', -apple-system, sans-serif;
}

html.dark {
  /* bg: JS overrides --bg to the theme-specific dark colour */
  --bg:           #1a1520;
  --bg-solid:     #1a1520;

  --surface:      #242435;
  --surface2:     #1e1e30;
  --border:       rgba(255,255,255,0.08);
  --border-md:    rgba(255,255,255,0.14);
  --text:         #e8eaed;
  --text-muted:   #9aa0a6;
  --text-hint:    #4a4a5a;
  --error-bg:     #3c1c1a;
  --success-bg:   #0d2e1a;
  --card-shadow:  0 2px 10px rgba(0,0,0,0.45);
  --card-shadow-hover: 0 4px 20px rgba(0,0,0,0.60);
}

/* OS-level dark (before user toggles) */
@media (prefers-color-scheme: dark) {
  html:not(.light) {
    --bg:        #1a1520;
    --bg-solid:  #1a1520;
    --surface:      #242435;
    --surface2:     #1e1e30;
    --border:       rgba(255,255,255,0.08);
    --border-md:    rgba(255,255,255,0.14);
    --text:         #e8eaed;
    --text-muted:   #9aa0a6;
    --text-hint:    #4a4a5a;
    --error-bg:     #3c1c1a;
    --success-bg:   #0d2e1a;
    --card-shadow:  0 2px 10px rgba(0,0,0,0.45);
    --card-shadow-hover: 0 4px 20px rgba(0,0,0,0.60);
  }
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s, color 0.25s;
}

/* Smooth dark/light transition for all cards and surfaces */
.ep-q-card, .ep-submit-card, .ep-card, .ep-form-header,
.ep-option, .ep-option-dot, .ep-option-check,
.ep-scale-dot, .ep-file-zone, .ep-file-chip,
.ep-grid-table th, .ep-grid-table td,
.ep-section-divider-content,
.ep-topbar, .ep-success-meta {
  transition: background 0.3s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

/* ── Page loader ── */
.page-loader {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s;
}
.page-loader.hidden { opacity: 0; pointer-events: none; }
.loader-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.loader-logo { width: 52px; height: 52px; border-radius: 14px; object-fit: contain; }
.loader-ring {
  width: 32px; height: 32px;
  border: 3px solid rgba(var(--theme-accent-rgb),0.15);
  border-top-color: var(--theme-accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ── */
.ep-toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #3c4043; color: #fff;
  font-family: var(--font); font-size: 13px; font-weight: 400;
  padding: 12px 22px;
  border-radius: 24px;
  z-index: 9000;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  max-width: calc(100vw - 32px);
}
.ep-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.ep-toast.toast-error   { background: #d93025; }
.ep-toast.toast-success { background: #188038; }

/* ── Topbar ── */
.ep-topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--surface) 88%, rgba(var(--theme-accent-rgb),1) 12%);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
}
html.dark .ep-topbar {
  background: color-mix(in srgb, var(--surface) 82%, rgba(var(--theme-accent-rgb),1) 18%);
}
@media (prefers-color-scheme: dark) {
  html:not(.light) .ep-topbar {
    background: color-mix(in srgb, var(--surface) 82%, rgba(var(--theme-accent-rgb),1) 18%);
  }
}
.ep-topbar-inner {
  max-width: 760px; margin: 0 auto; padding: 0 24px;
  height: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.ep-brand { display: flex; align-items: center; gap: 10px; }
.ep-brand-icon { width: 28px; height: 28px; border-radius: 7px; object-fit: contain; }
.ep-brand-name {
  font-size: 16px; font-weight: 600;
  color: var(--theme-accent);
  letter-spacing: -0.02em;
}

.ep-theme-btn {
  background: none; border: none;
  border-radius: 50%; width: 36px; height: 36px;
  cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.ep-theme-btn:hover { background: rgba(var(--theme-accent-rgb),0.10); color: var(--theme-accent); }
/* Icon visibility: sun shown in dark, moon shown in light */
.icon-moon { display: none; }
.icon-sun  { display: flex; }
html.dark .icon-moon { display: flex; }
html.dark .icon-sun  { display: none; }
@media (prefers-color-scheme: dark) {
  html:not(.light) .icon-moon { display: flex; }
  html:not(.light) .icon-sun  { display: none; }
}

/* ── Main layout ── */
.ep-main {
  max-width: 680px;
  margin: 0 auto;
  padding: calc(var(--topbar-h) + 32px) 16px 80px;
}

/* ── Sections ── */
.ep-section { animation: fadeUp 0.4s cubic-bezier(0.22,1,0.36,1) both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* ── Form header card ── */
.ep-form-header {
  background: var(--surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: var(--card-shadow);
  border-top: 8px solid var(--theme-accent);
}

.ep-form-banner {
  width: 100%;
  display: none;
  line-height: 0;
}
.ep-form-banner.visible { display: block; }

.ep-form-header-body { padding: 28px 32px 26px; }
@media (max-width: 480px) { .ep-form-header-body { padding: 22px 20px 18px; } }

.ep-timer-row {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em;
  color: #fff;
  background: var(--theme-accent);
  padding: 4px 12px; border-radius: 20px;
  margin-bottom: 14px;
  text-transform: uppercase;
}
.ep-timer-row.urgent { background: #d93025; animation: pulse 1s ease infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.65; } }

.ep-form-title {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin-bottom: 10px;
}
.ep-form-desc {
  font-size: 14px; font-weight: 300;
  color: var(--text-muted); line-height: 1.65;
}

/* ── Question cards ── */
.ep-q-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  margin-bottom: 12px;
  box-shadow: var(--card-shadow);
  border-left: 5px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ep-q-card:focus-within {
  border-left-color: var(--theme-accent);
  box-shadow: var(--card-shadow-hover);
}
.ep-q-card.has-error { border-left-color: var(--error-color) !important; }
@media (max-width: 480px) { .ep-q-card { padding: 20px 16px; } }

.ep-q-label {
  font-size: 15px; font-weight: 500;
  color: var(--text); line-height: 1.45;
  margin-bottom: 18px;
  display: flex; gap: 4px;
}
.ep-q-required { color: var(--error-color); margin-left: 2px; }

.ep-q-error {
  font-size: 12px; font-weight: 500;
  color: var(--error-color); margin-top: 10px;
  display: none; align-items: center; gap: 6px;
}
.ep-q-card.has-error .ep-q-error { display: flex; }

/* ── Inputs — Google underline style ── */
.ep-input {
  width: 100%;
  padding: 10px 0 8px;
  font-size: 14px; font-weight: 400;
  font-family: var(--font);
  color: var(--text);
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--border-md);
  border-radius: 0;
  outline: none;
  transition: border-color 0.2s, color 0.2s;
  -webkit-appearance: none;
  /* Date/time inputs need explicit colour in dark mode */
  color-scheme: light;
}
html.dark .ep-input,
html.dark input.ep-input,
html.dark textarea.ep-input {
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html:not(.light) .ep-input { color-scheme: dark; }
}
.ep-input::placeholder { color: var(--text-hint); }
.ep-input:hover { border-bottom-color: var(--text-muted); }
.ep-input:focus { border-bottom-color: var(--theme-accent); box-shadow: 0 1px 0 var(--theme-accent); }
.ep-input:disabled { opacity: 0.55; cursor: not-allowed; }
.ep-textarea { resize: vertical; min-height: 90px; line-height: 1.6; padding-top: 8px; }

.ep-select {
  appearance: none;
  background-color: var(--surface);
  color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding: 10px 36px 10px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-md);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.ep-select:hover { border-color: var(--text-muted); }
.ep-select:focus { border-color: var(--theme-accent); outline: none; box-shadow: 0 0 0 3px rgba(var(--theme-accent-rgb),0.15); }
/* Dark mode chevron (white stroke) */
html.dark .ep-select,
html.dark .ep-select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239aa0a6' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  html:not(.light) .ep-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239aa0a6' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  }
}
/* Native select option dark background */
.ep-select option { background: var(--surface); color: var(--text); }

/* ── Radio & checkbox options ── */
.ep-options { display: flex; flex-direction: column; gap: 8px; }

.ep-option {
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface2);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  user-select: none;
}
.ep-option:hover {
  border-color: rgba(var(--theme-accent-rgb),0.4);
  background: rgba(var(--theme-accent-rgb),0.04);
  box-shadow: 0 1px 4px rgba(var(--theme-accent-rgb),0.08);
}
.ep-option.selected {
  border-color: var(--theme-accent);
  background: rgba(var(--theme-accent-rgb),0.06);
}

.ep-option input[type="radio"],
.ep-option input[type="checkbox"] { display: none; }

.ep-option-dot {
  width: 20px; height: 20px;
  border: 2px solid var(--border-md);
  border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s;
  background: var(--surface);
}
.ep-option.selected .ep-option-dot,
.ep-option input[type="radio"]:checked ~ .ep-option-dot { border-color: var(--theme-accent); }
.ep-option input[type="radio"]:checked ~ .ep-option-dot::after {
  content: '';
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--theme-accent);
  animation: radioIn 0.15s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes radioIn { from { transform: scale(0); } to { transform: scale(1); } }

.ep-option-check {
  width: 20px; height: 20px;
  border: 2px solid var(--border-md);
  border-radius: 5px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, background 0.15s;
  background: var(--surface);
}
.ep-option input[type="checkbox"]:checked ~ .ep-option-check {
  border-color: var(--theme-accent);
  background: var(--theme-accent);
}
.ep-option input[type="checkbox"]:checked ~ .ep-option-check::after {
  content: '';
  width: 11px; height: 7px;
  border-left: 2.5px solid #fff;
  border-bottom: 2.5px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}
.ep-option input[type="radio"]:checked   ~ .ep-option-label,
.ep-option input[type="checkbox"]:checked ~ .ep-option-label { color: var(--text); font-weight: 500; }

.ep-option-label { font-size: 14px; color: var(--text-muted); flex: 1; line-height: 1.4; }

.ep-other-input { margin-top: 10px; }

/* ── Linear scale ── */
.ep-scale-wrap { overflow-x: auto; padding-bottom: 4px; }
.ep-scale-grid {
  display: flex; gap: 8px; align-items: stretch;
  min-width: max-content; padding: 4px 2px;
}
.ep-scale-labels {
  display: flex; justify-content: space-between;
  font-size: 11px; font-weight: 600;
  color: var(--text-hint);
  margin-top: 10px; padding: 0 4px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.ep-scale-item { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ep-scale-num { font-size: 12px; font-weight: 500; color: var(--text-hint); }
.ep-scale-radio { display: none; }
.ep-scale-dot {
  width: 42px; height: 42px;
  border: 2px solid var(--border-md);
  border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.ep-scale-dot:hover {
  border-color: var(--theme-accent);
  color: var(--theme-accent);
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(var(--theme-accent-rgb),0.2);
}
.ep-scale-radio:checked + .ep-scale-dot {
  border-color: var(--theme-accent);
  background: var(--theme-accent);
  color: #fff;
  box-shadow: 0 2px 12px rgba(var(--theme-accent-rgb),0.4);
  transform: scale(1.08);
}

/* ── Grid table ── */
.ep-grid-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.ep-grid-table th {
  font-size: 12px; font-weight: 600;
  color: var(--text-muted); padding: 8px 12px;
  text-align: center;
  background: var(--surface2);
  border-bottom: 1.5px solid var(--border-md);
}
.ep-grid-table th:first-child { text-align: left; }
.ep-grid-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: center; }
.ep-grid-table td:first-child { text-align: left; color: var(--text); font-weight: 500; }
.ep-grid-table tr:last-child td { border-bottom: none; }
.ep-grid-table tr:hover td { background: rgba(var(--theme-accent-rgb),0.05); }
.ep-grid-radio, .ep-grid-check {
  width: 18px; height: 18px; cursor: pointer; accent-color: var(--theme-accent);
}

/* ── File upload zone ── */
.ep-file-zone {
  border: 2px dashed var(--border-md);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--surface2);
}
.ep-file-zone:hover, .ep-file-zone.dragover {
  border-color: var(--theme-accent);
  background: rgba(var(--theme-accent-rgb),0.04);
}
.ep-file-zone-icon { color: var(--text-hint); margin-bottom: 12px; transition: color 0.2s; }
.ep-file-zone:hover .ep-file-zone-icon { color: var(--theme-accent); }
.ep-file-zone p { font-size: 14px; font-weight: 500; color: var(--text-muted); margin-bottom: 4px; }
.ep-file-zone span { font-size: 12px; color: var(--text-hint); }
.ep-file-input { display: none; }
.ep-file-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.ep-file-chip {
  display: flex; align-items: center; gap: 10px;
  background: rgba(var(--theme-accent-rgb),0.05);
  border: 1.5px solid rgba(var(--theme-accent-rgb),0.18);
  border-radius: var(--radius-lg);
  padding: 10px 14px; font-size: 13px;
}
.ep-file-chip-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 500; }
.ep-file-chip-size { font-size: 11px; color: var(--text-hint); white-space: nowrap; }
.ep-file-chip-rm {
  background: none; border: none; cursor: pointer;
  color: var(--text-hint); padding: 3px;
  display: flex; border-radius: 50%;
  transition: color 0.15s, background 0.15s;
}
.ep-file-chip-rm:hover { color: var(--error-color); background: var(--error-bg); }

/* ── Submit card ── */
.ep-submit-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 24px 32px;
  margin-top: 4px;
  margin-bottom: 16px;
  box-shadow: var(--card-shadow);
  display: flex; flex-direction: column; gap: 14px;
}

/* ── Submit button ── */
.ep-submit-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 14px 28px;
  font-size: 15px; font-weight: 600; font-family: var(--font);
  background: var(--theme-accent); color: #fff;
  border: none; border-radius: var(--radius-lg);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.1s, opacity 0.15s;
  letter-spacing: -0.01em;
  box-shadow: 0 2px 8px rgba(var(--theme-accent-rgb),0.35);
}
.ep-submit-btn:hover:not(:disabled)  { box-shadow: 0 4px 18px rgba(var(--theme-accent-rgb),0.45); }
.ep-submit-btn:active:not(:disabled) { transform: scale(0.985); }
.ep-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.ep-outline-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 28px; width: auto;
  font-size: 14px; font-family: var(--font); font-weight: 500;
  background: none;
  border: 1.5px solid rgba(var(--theme-accent-rgb),0.35);
  border-radius: var(--radius-lg);
  color: var(--theme-accent); cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  margin: 0 auto;
}
.ep-outline-btn:hover { background: rgba(var(--theme-accent-rgb),0.06); border-color: var(--theme-accent); }

.ep-footer-note {
  font-size: 12px; color: var(--text-hint);
  text-align: center; display: flex; align-items: center; justify-content: center; gap: 5px;
}

/* ── Login card ── */
.ep-login-card { max-width: 420px; margin: 0 auto; }
.ep-login-card .ep-submit-btn { margin-top: 8px; }

/* ── Generic cards ── */
.ep-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  margin-bottom: 12px;
  box-shadow: var(--card-shadow);
}
@media (max-width: 480px) { .ep-card { padding: 30px 22px; } }

.ep-card-icon {
  width: 64px; height: 64px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 22px;
}
.accent-icon  { background: rgba(var(--theme-accent-rgb),0.1); color: var(--theme-accent); }
.success-icon { background: var(--success-bg); color: var(--success-color); }
.error-icon   { background: var(--error-bg); color: var(--error-color); }

.ep-card-title {
  font-size: 22px; font-weight: 600;
  color: var(--text); text-align: center;
  margin-bottom: 8px; letter-spacing: -0.02em;
}
.ep-card-sub {
  font-size: 14px; font-weight: 300;
  color: var(--text-muted); text-align: center;
  line-height: 1.6; margin-bottom: 22px;
}

.ep-field-group { margin-bottom: 18px; }
.ep-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-muted); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.ep-field-error {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--error-bg);
  border-left: 3px solid var(--error-color);
  color: var(--error-color); font-size: 13px;
  padding: 10px 14px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 16px; line-height: 1.4;
}

.ep-success-card, .ep-error-card { text-align: center; max-width: 460px; margin: 0 auto; }
.ep-success-meta {
  font-size: 13px; color: var(--text-muted);
  background: var(--surface2);
  border-radius: var(--radius-lg);
  padding: 14px 18px; margin-bottom: 18px; text-align: left;
  border: 1px solid var(--border);
  line-height: 1.8;
}

.ep-upload-progress { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.ep-upload-fill { height: 100%; border-radius: 2px; background: var(--theme-accent); transition: width 0.3s; }

.ep-btn-spinner {
  width: 16px; height: 16px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .ep-main { padding-left: 10px; padding-right: 10px; }
  .ep-scale-dot { width: 34px; height: 34px; font-size: 12px; }
  .ep-submit-btn { font-size: 14px; padding: 13px 20px; }
  .ep-submit-card { padding: 20px 16px; }
}

/* ── Animated underline wrapper (Google Forms signature) ── */
.ep-input-wrap { position: relative; }
.ep-input-wrap::after {
  content: '';
  position: absolute; bottom: 0; left: 50%; right: 50%;
  height: 2px;
  background: var(--theme-accent);
  transition: left 0.25s cubic-bezier(0.4,0,0.2,1), right 0.25s cubic-bezier(0.4,0,0.2,1);
  border-radius: 1px;
}
.ep-input-wrap:focus-within::after { left: 0; right: 0; }
/* Remove double border on focus inside wrap */
.ep-input-wrap .ep-input:focus { box-shadow: none; border-bottom-color: transparent; }
/* ============================================================
   Extended styles — theme-tinted background, section dividers,
   paged navigation, progress bar, char counter, validation,
   helper text.  All colour-scheme aware (light + dark).
   ============================================================ */

/* ── Section divider on form page ── */
.ep-section-divider { margin: 4px 0 2px; }
.ep-section-divider-content {
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  border-top: 4px solid var(--theme-accent);
  padding: 18px 28px 14px;
  box-shadow: var(--card-shadow);
}
.ep-section-divider-title {
  font-size: 18px; font-weight: 500;
  color: var(--text); margin-bottom: 4px;
}
.ep-section-divider-desc {
  font-size: 13px; color: var(--text-muted); line-height: 1.5;
}

/* ── Helper text ── */
.ep-q-helper {
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 10px; line-height: 1.4; font-style: italic;
}

/* ── Real-time validation (amber) ── */
.ep-q-card.has-validation-error { border-left-color: #f59e0b !important; }
.ep-q-card.has-validation-error .ep-q-error {
  display: block; color: #92400e;
  background: #fffbeb; border-left-color: #f59e0b;
}
html.dark .ep-q-card.has-validation-error .ep-q-error {
  color: #fcd34d; background: #1c1500; border-left-color: #b45309;
}
@media (prefers-color-scheme: dark) {
  html:not(.light) .ep-q-card.has-validation-error .ep-q-error {
    color: #fcd34d; background: #1c1500; border-left-color: #b45309;
  }
}

/* ── Character counter ── */
.ep-char-counter {
  font-size: 11px; color: var(--text-hint);
  text-align: right; margin-top: 4px; line-height: 1;
  transition: color 0.15s; user-select: none;
}
.ep-char-counter.over { color: var(--error-color); font-weight: 600; }

/* ── Page progress bar ── */
.ep-page-progress { margin-bottom: 14px; }
.ep-page-progress-bar {
  height: 5px;
  background: rgba(var(--theme-accent-rgb), 0.18);
  border-radius: 3px; overflow: hidden; margin-bottom: 7px;
}
/* progress bar track colour is set via rgba(--theme-accent-rgb) which adapts automatically */
.ep-page-progress-fill {
  height: 100%;
  background: var(--theme-accent);
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
  min-width: 0;
}
.ep-page-progress-label {
  font-size: 11px; color: var(--text-muted);
  font-weight: 500; letter-spacing: 0.02em;
}

/* ── Navigation bar ── */
.ep-nav-bar {
  display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
  margin-top: 12px; margin-bottom: 8px; padding: 0 2px;
}
.ep-nav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 22px; border-radius: var(--radius-md);
  border: none; font-size: 14px; font-weight: 500;
  font-family: var(--font); cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  user-select: none; white-space: nowrap;
}
.ep-nav-btn:active { transform: scale(0.97); }

.ep-nav-next {
  background: var(--theme-accent); color: #fff; margin-left: auto;
  box-shadow: 0 2px 8px rgba(var(--theme-accent-rgb), 0.35);
}
.ep-nav-next:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 14px rgba(var(--theme-accent-rgb), 0.45);
}
.ep-nav-back {
  background: var(--surface); color: var(--text-muted);
  border: 1px solid var(--border-md);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ep-nav-back:hover { background: var(--surface2); color: var(--text); border-color: var(--border-md); }

.ep-nav-page-label {
  font-size: 13px; color: var(--text-hint);
  font-weight: 500; letter-spacing: 0.03em;
  flex: 1; text-align: center; user-select: none;
}

/* ── Page transition animations ── */
@keyframes epSlideInRight {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: none; }
}
@keyframes epSlideInLeft {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: none; }
}
.ep-page-enter      { animation: epSlideInRight 0.28s cubic-bezier(0.22,1,0.36,1) both; }
.ep-page-enter-back { animation: epSlideInLeft  0.28s cubic-bezier(0.22,1,0.36,1) both; }