/* Switch EcoMobility design system ("The Charge Line"),
   from switch-ecomobility-landing/DESIGN.md:
   white ground, mist, navy ink; the teal→lime gradient appears only as charge
   (lines, fills, the bolt); hard edges everywhere; no shadows on UI. */
:root {
  --ground: #ffffff;
  --mist: #f3f5f7;
  --line: #dde2e8;
  --line-strong: #b9c1cb;
  --ink: #131d33;
  --ink-deep: #0c1426;
  --ink-soft: #4a5468;
  --ink-faint: #636c7f;
  /* Charge colours sampled from the logo's bolt. */
  --teal: #00cbbb;
  --lime: #7dc842;
  --teal-ink: #0e7c74;
  --alert: #b42318;
  --charge-x: linear-gradient(90deg, var(--teal), var(--lime));
  --charge-y: linear-gradient(180deg, var(--teal), var(--lime));
  --ease-charge: cubic-bezier(0.16, 1, 0.3, 1);
  --font: Archivo, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font: 400 1.0625rem/1.625 var(--font);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--teal); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgb(0 203 187 / 0.4);
}

/* ---------- Type ---------- */

h1, h2 { text-wrap: balance; }

/* The Wide Voice Rule: only headings go wide. */
h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 0.98;
  letter-spacing: -0.025em;
}
h2 { margin: 0 0 1rem; font-size: 1.25rem; font-weight: 600; line-height: 1.4; }

.details { margin: 0 0 2rem; color: var(--ink-soft); font-size: 1.125rem; }
.muted { color: var(--ink-faint); font-size: 0.9375rem; font-weight: 400; }

/* ---------- Page shell ---------- */

.wrap {
  max-width: 36rem;
  margin: 0 auto;
  padding: 2rem 20px 4rem;
}
.wrap.wide { max-width: 64rem; }
@media (min-width: 640px) { .wrap { padding: 2.5rem 32px 6rem; } }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 3rem;
}
.topbar form { margin: 0; }

.logo { display: block; flex: none; align-self: flex-start; width: auto; height: 36px; }

/* ---------- Buttons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  color: var(--ground);
  font: 600 1rem/1.2 var(--font);
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transition: background-color 200ms var(--ease-charge);
}
/* The charge underbar: rests at 18%, fills on hover and focus. */
.btn::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--charge-x);
  transform: scaleX(0.18);
  transform-origin: left;
  transition: transform 500ms var(--ease-charge);
}
.btn:hover { background: var(--ink-deep); }
.btn:hover::after, .btn:focus-visible::after { transform: scaleX(1); }
.btn .arrow { flex: none; transition: transform 500ms var(--ease-charge); }
.btn:hover .arrow, .btn:focus-visible .arrow { transform: translateX(4px); }
.btn[disabled] { cursor: progress; background: var(--ink-deep); }
.btn[disabled]::after { animation: charging 1.2s var(--ease-charge) infinite; }

.btn.block { width: 100%; justify-content: space-between; }

/* Outline button: white, strong hairline, no charge. */
.btn.ghost {
  background: var(--ground);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn.ghost::after { display: none; }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--ink); background: var(--ground); }
.btn.ghost:focus-visible { box-shadow: inset 0 0 0 1px var(--ink), 0 0 0 6px rgb(0 203 187 / 0.4); }

.btn.small { min-height: 44px; padding: 0 16px; font-size: 0.9375rem; }

@keyframes charging {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* ---------- Forms ---------- */

form { margin: 1.5rem 0; }

label { display: grid; gap: 0.375rem; font-size: 0.875rem; font-weight: 600; }

input, textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1rem/1.4 var(--font);
  transition: border-color 150ms, box-shadow 150ms;
}
input::placeholder { color: var(--ink-faint); }
input:hover, textarea:hover { border-color: var(--ink-faint); }
input:focus-visible, textarea:focus-visible, input:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgb(0 203 187 / 0.3);
}
input[aria-invalid="true"] { border-color: rgb(180 35 24 / 0.6); }
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8125rem; resize: vertical; }

.field-error {
  margin: 0 0 1.25rem;
  padding: 12px 16px;
  border: 1px solid rgb(180 35 24 / 0.4);
  background: #fff6f5;
  color: var(--alert);
  font-size: 0.9375rem;
  font-weight: 600;
}

/* ---------- Notices ---------- */

/* Light notice: a charge line on the left edge. */
.notice {
  position: relative;
  margin: 1.5rem 0;
  padding: 1rem 1.25rem 1rem 1.5rem;
  background: var(--ground);
  border: 1px solid var(--line);
}
.notice::before {
  content: "";
  position: absolute;
  inset: -1px auto -1px -1px;
  width: 3px;
  background: var(--charge-y);
}
.notice p { margin: 0; }
.notice.err { border-color: rgb(180 35 24 / 0.4); background: #fff6f5; color: var(--alert); }
.notice.err::before { background: var(--alert); }

/* The One Navy Panel: the guest's confirmation. */
.notice.ok {
  padding: 1.75rem 1.75rem 1.75rem;
  border: 0;
  background: var(--ink);
  color: rgb(255 255 255 / 0.75);
}
.notice.ok::before {
  inset: auto 0 0 0;
  width: auto;
  height: 4px;
  background: var(--charge-x);
  transform-origin: left;
  animation: charge-x 1.1s var(--ease-charge) both;
}
.notice.ok .notice-title { color: var(--ground); }
.notice-title {
  margin-bottom: 0.375rem !important;
  font-size: 1.375rem;
  font-weight: 800;
  font-stretch: 125%;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

/* ---------- Admin ---------- */

.card {
  margin: 0 0 1.5rem;
  padding: 24px 20px;
  background: var(--ground);
  border: 1px solid var(--line);
}
@media (min-width: 640px) { .card { padding: 32px; } }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0; }
.grid .full { grid-column: 1 / -1; }
@media (max-width: 40rem) { .grid { grid-template-columns: 1fr; } }

.preview { padding: 1rem 1.25rem; border: 1px dashed var(--line-strong); background: var(--ground); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }
.copied { min-height: 1.5rem; margin: 0.5rem 0 0; color: var(--teal-ink); font-size: 0.9375rem; font-weight: 600; }
details { margin-top: 0.5rem; }
summary { cursor: pointer; color: var(--ink-soft); font-size: 0.9375rem; min-height: 44px; display: flex; align-items: center; }
details textarea { margin-top: 0.5rem; }

.row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.row h2 { margin: 0; }

.table-scroll { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 0.9375rem; font-variant-numeric: tabular-nums lining-nums; }
.list th, .list td { padding: 0.625rem 0.75rem 0.625rem 0; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.list th { font-size: 0.875rem; font-weight: 600; color: var(--ink-faint); }

.pill { display: inline-block; padding: 0.125rem 0.5rem; font-size: 0.8125rem; font-weight: 600; background: var(--mist); color: var(--ink-soft); }
.pill.unsent { background: #fdf0e1; color: #8a4b08; }
.pill.sent { background: var(--mist); color: var(--ink-soft); }
.pill.confirmed { background: #e3f4f2; color: var(--teal-ink); }

.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0 0 1rem; border-bottom: 1px solid var(--line); }
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.875rem;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}
.tab span { color: var(--ink-faint); font-weight: 400; margin-left: 0.375rem; font-variant-numeric: tabular-nums; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); }
/* Active tab: 2px charge underline. */
.tab[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--charge-x);
}

form.inline { display: inline; margin: 0; }
.list td.act { text-align: right; padding-right: 0; }

.sent-step {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem;
  margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line);
}
.sent-step p { margin: 0; color: var(--ink-soft); font-size: 0.9375rem; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Login ---------- */

.login-body { background: var(--ground); }

.login {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}
@media (min-width: 900px) {
  .login { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.login-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
  padding: 2rem 20px;
}
@media (min-width: 640px) { .login-panel { padding: 2.5rem 32px; } }
@media (min-width: 1280px) { .login-panel { padding: 3rem 48px 3rem 112px; } }

/* Phones: the art panel is hidden, so a charge rule opens the page instead. */
.login-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--charge-x);
  transform-origin: left;
  animation: charge-x 1.1s var(--ease-charge) both;
}
@media (min-width: 900px) { .login-panel::before { display: none; } }

.login-panel .logo { height: 44px; }
.login-main { width: 100%; max-width: 26rem; }
.login-main h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); margin-bottom: 0.875rem; }
.lede { margin: 0 0 2.25rem; color: var(--ink-soft); font-size: 1.125rem; text-wrap: pretty; }

.login-form { display: grid; gap: 0.375rem; margin: 0; }
.login-form label { margin-top: 0.875rem; }
.login-form label:first-of-type { margin-top: 0; }
.login-form .btn { margin-top: 1.75rem; min-height: 56px; padding: 0 28px; }

.password { position: relative; }
.password input { padding-right: 84px; }
.reveal {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  min-width: 72px;
  padding: 0 16px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: var(--ground);
  color: var(--teal-ink);
  font: 600 0.875rem/1 var(--font);
  cursor: pointer;
}
.reveal:hover { color: var(--ink); }
.reveal:focus-visible { outline-offset: -2px; box-shadow: none; }

.fine { margin: 0; max-width: 40ch; color: var(--ink-faint); font-size: 0.875rem; }

.login-art {
  position: relative;
  display: none;
  place-items: center;
  background: var(--mist);
  overflow: hidden;
}
@media (min-width: 900px) { .login-art { display: grid; } }

/* The spine: a hairline on the panel's edge that charges top-down. */
.login-art::before,
.login-art::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 1px;
}
.login-art::before { background: var(--line); }
.login-art::after {
  width: 2px;
  background: var(--charge-y);
  transform-origin: top;
  animation: charge-y 1.6s var(--ease-charge) 0.1s both;
}

.bolt { width: auto; height: min(68vh, 600px); }
.bolt .charge-up {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: charge-up 1.6s var(--ease-charge) 0.35s both;
}

@keyframes charge-up { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes charge-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes charge-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Motion is charging; under reduced motion everything rests fully charged. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .btn::after { transform: scaleX(0.18); }
}
