/* ─────────────────────────────────────────────────────────────
   Account, basket, checkout and order pages.

   Uses the same design tokens as the Phase 1 site — no new colours,
   fonts or radii are introduced here. Forms and tables are given the
   same paper/ink treatment as the rest of the storefront.
   ───────────────────────────────────────────────────────────── */

/* ── Forms ──────────────────────────────────────────────────── */

.form-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: clamp(1.75rem, 4vw, 2.75rem);
}

.form-narrow { max-width: 30rem; margin-inline: auto; }
.form-wide { max-width: 44rem; }

.field { display: grid; gap: 0.4rem; margin-bottom: 1.15rem; }

.field label,
.field > label {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="tel"],
.field input[type="url"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  min-height: 3.1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  padding: 0.75rem 1rem;
  color: var(--ink);
}

.field textarea { min-height: auto; line-height: 1.6; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
  background: #fff;
}

.field .helptext {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
}

.field-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.15rem;
}

.field-check label {
  font-size: 0.9rem;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
  color: var(--ink-soft);
}

.field-row { display: grid; gap: 0 1rem; }

@media (min-width: 620px) {
  .field-row { grid-template-columns: 1fr 1fr; }
}

.errorlist {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  color: #b00;
  font-size: 0.82rem;
  font-weight: 600;
}

.form-error-summary {
  border: 1px solid rgba(187, 0, 0, 0.25);
  background: rgba(187, 0, 0, 0.05);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.4rem;
  color: #8a1010;
  font-size: 0.9rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
}

.form-aside {
  margin-top: 1.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.form-aside a { color: var(--accent-deep); font-weight: 700; }
.form-aside a:hover { text-decoration: underline; }

/* ── Messages ───────────────────────────────────────────────── */

.messages { display: grid; gap: 0.6rem; margin-bottom: 1.8rem; }

.message {
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.15rem;
  font-size: 0.9rem;
  border: 1px solid var(--line);
  background: var(--paper-2);
}

.message.success { border-color: rgba(61, 107, 79, 0.3); background: rgba(61, 107, 79, 0.08); color: #274a37; }
.message.error   { border-color: rgba(187, 0, 0, 0.25); background: rgba(187, 0, 0, 0.05); color: #8a1010; }
.message.warning { border-color: var(--accent-soft); background: rgba(192, 106, 73, 0.08); color: var(--accent-deep); }

/* ── Account layout ─────────────────────────────────────────── */

.account-grid { display: grid; gap: 2rem; }

@media (min-width: 900px) {
  .account-grid { grid-template-columns: 15rem 1fr; gap: 3rem; align-items: start; }
}

.account-nav {
  display: grid;
  gap: 0.15rem;
  align-content: start;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.account-nav a {
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: 0.2s var(--ease-out);
}

.account-nav a:hover { background: var(--paper-2); color: var(--ink); }
.account-nav a.active { background: var(--ink); color: var(--paper); }
.account-nav .sep { height: 1px; background: var(--line); margin: 0.6rem 0; }

.tile-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  margin-bottom: 2.5rem;
}

.tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem;
  box-shadow: var(--shadow-sm);
}

.tile strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.tile span {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

.card-list { display: grid; gap: 1rem; }

.list-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: grid;
  gap: 0.5rem;
}

.list-card .list-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.list-card address { font-style: normal; color: var(--ink-soft); line-height: 1.6; }

.empty-note {
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

/* ── Status pills ───────────────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pill-pending  { background: rgba(192, 106, 73, 0.14); color: var(--accent-deep); }
.pill-approved { background: rgba(61, 107, 79, 0.14); color: #2c5540; }
.pill-declined { background: rgba(187, 0, 0, 0.1); color: #8a1010; }
.pill-neutral  { background: var(--paper-deep); color: var(--ink-soft); }

/* ── Basket ─────────────────────────────────────────────────── */

.cart-layout { display: grid; gap: 2.5rem; align-items: start; }

@media (min-width: 900px) {
  .cart-layout { grid-template-columns: 1fr 21rem; gap: 3rem; }
}

.cart-line {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1.1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.cart-line-media {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--paper-deep);
  aspect-ratio: 4 / 5;
}

.cart-line-media img { width: 100%; height: 100%; object-fit: cover; }

.cart-line h3 { font-size: 1.1rem; margin-bottom: 0.15rem; }
.cart-line .cart-line-brand { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--skin-4); font-weight: 700; }

.cart-line-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.7rem;
}

.qty-form { display: flex; align-items: center; gap: 0.4rem; }

.qty-form input {
  width: 4.5rem;
  min-height: 2.5rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
  text-align: center;
  background: var(--paper);
}

.link-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.link-button:hover { color: #b00; }

.cart-line-price { text-align: right; margin-left: auto; }
.cart-line-price strong { font-size: 1.05rem; font-weight: 800; }
.cart-line-price .each { display: block; font-size: 0.78rem; color: var(--muted); }

.summary {
  background: var(--paper-2);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.summary h2 {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  font-size: 0.92rem;
}

.summary-row.total {
  border-top: 1px solid var(--line-strong);
  margin-top: 0.6rem;
  padding-top: 0.9rem;
  font-size: 1.15rem;
  font-weight: 800;
}

.summary .btn { width: 100%; margin-top: 1.2rem; }

.summary-note { margin-top: 0.9rem; font-size: 0.8rem; color: var(--muted); }

.problem-list {
  border: 1px solid rgba(187, 0, 0, 0.25);
  background: rgba(187, 0, 0, 0.05);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  margin-bottom: 1.5rem;
}

.problem-list p {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
  color: #8a1010;
  margin-bottom: 0.5rem;
}

.problem-list ul { margin: 0; padding-left: 1.1rem; color: #8a1010; font-size: 0.9rem; }

/* Add-to-basket control on the product page */
.add-to-cart { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-bottom: 1rem; }
.add-to-cart input[type="number"] {
  width: 5rem;
  min-height: 3.15rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  text-align: center;
  background: var(--paper);
}

/* Header basket link */
.cart-link { position: relative; }

.cart-count {
  position: absolute;
  top: -0.3rem;
  right: -0.3rem;
  min-width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  padding: 0 0.28rem;
}

/* ── Order status ───────────────────────────────────────────── */

.order-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
}

.order-head h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
.order-head .order-meta { color: var(--muted); font-size: 0.9rem; }

.timeline {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 0 2.5rem;
}

.timeline-step { text-align: center; position: relative; padding-top: 2.2rem; }

.timeline-step::before {
  content: "";
  position: absolute;
  top: 0.55rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--paper-deep);
  border: 2px solid var(--line-strong);
  z-index: 2;
}

.timeline-step::after {
  content: "";
  position: absolute;
  top: 1.05rem;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--line);
  z-index: 1;
}

.timeline-step:last-child::after { display: none; }

.timeline-step.done::before { background: var(--accent); border-color: var(--accent); }
.timeline-step.done::after { background: var(--accent); }
.timeline-step.current::before { box-shadow: 0 0 0 5px rgba(192, 106, 73, 0.18); }

.timeline-step span {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

.timeline-step.done span { color: var(--ink); }

.order-grid { display: grid; gap: 2rem; }

@media (min-width: 900px) {
  .order-grid { grid-template-columns: 1fr 20rem; gap: 3rem; align-items: start; }
}

.order-table { width: 100%; border-collapse: collapse; }

.order-table th {
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line-strong);
}

.order-table td { padding: 0.9rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.order-table td:last-child, .order-table th:last-child { text-align: right; }
.order-table .sku { display: block; font-size: 0.78rem; color: var(--muted); }

.info-panel {
  background: var(--paper-2);
  border-radius: var(--radius);
  padding: 1.4rem;
  display: grid;
  gap: 1.2rem;
}

.info-panel h2 {
  font-family: var(--font-body);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.info-panel address { font-style: normal; color: var(--ink-soft); line-height: 1.65; }

.confirm-hero { text-align: center; max-width: 34rem; margin-inline: auto; }
.confirm-hero .tick {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: rgba(61, 107, 79, 0.12);
  color: #2c5540;
  display: grid;
  place-items: center;
  font-size: 2rem;
  margin: 0 auto 1.5rem;
}
.confirm-hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 0.8rem; }
.confirm-hero p { color: var(--ink-soft); margin-bottom: 0.6rem; }
.confirm-hero .order-number {
  display: inline-block;
  margin: 1.2rem 0;
  padding: 0.7rem 1.4rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  font-weight: 800;
  letter-spacing: 0.1em;
}

/* ── Continue with Google ─────────────────────────────────────────
   Google's brand guidelines fix the mark and the wording; the frame,
   typeface and spacing follow the rest of the site so the button reads as
   part of the page rather than a bolted-on widget. */

.social-auth {
  margin-top: 1.6rem;
}

/* Rule with the word "or" sitting in a gap, drawn with two flex lines so it
   works at any width without a background-matched label. */
.social-divider {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0 0 1.2rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.social-divider::before,
.social-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.85rem 1.2rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-google:hover {
  border-color: var(--ink);
  box-shadow: 0 4px 14px rgba(28, 25, 23, 0.09);
}

/* Keyboard focus must stay visible: this is a sign-in control, and it is the
   one people tab to. */
.btn-google:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.btn-google-mark {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

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

/* ── Postcode lookup ──────────────────────────────────────────────
   The button and picker are injected by static/js/postcode.js, so none of
   this renders unless the enhancement is active. */

.postcode-lookup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.55rem;
}

.postcode-lookup-btn {
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  white-space: nowrap;
}

.postcode-lookup-picker {
  flex: 1 1 16rem;
  min-width: 0;              /* lets a long address ellipsize instead of
                                stretching the form */
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink);
}

.postcode-lookup-status {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.postcode-lookup-status.is-error {
  color: #b3261e;
}

/* ── Enquiry form ─────────────────────────────────────────────────
   .hp-wrap holds the honeypot. Positioned off-screen rather than
   display:none, because some bots skip hidden fields but fill anything they
   can "see" in the DOM. */

.hp-wrap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.enquiry-section {
  padding-top: 0;
}

.enquiry-lead {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.enquiry-context {
  margin: 0 0 0.9rem;
  padding: 0.7rem 0.9rem;
  background: var(--tint-butter, var(--paper-2));
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.form-smallprint {
  margin: 1rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ── Voucher box in the basket ────────────────────────────────── */

.voucher-box {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.voucher-form label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.voucher-input-row {
  display: flex;
  gap: 0.5rem;
}

.voucher-input-row input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  /* Codes are stored uppercase; showing them that way avoids a customer
     thinking their lowercase entry was rejected for case. */
  text-transform: uppercase;
}

.voucher-input-row .btn {
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  white-space: nowrap;
}

.voucher-error {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: #b3261e;
}

.voucher-applied {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0;
  font-size: 0.9rem;
}

.voucher-remove {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}

.summary-row.discount-row {
  color: #1f7a4d;
}
