/* ln-system.css — the platform's own stylesheet for the pages it renders itself inside a theme's
   layout/system.html: checkout, the confirmation page, the account and sign-in pages, the cart-import,
   subscribe and preference-centre pages (docs/theme-plan.md D4). Loaded by ln.head on those pages
   whatever the theme, so the money path never depends on a theme's CSS; every colour token carries
   Base's value as its fallback, and a theme restyles these forms through the same --palm / --ink /
   --line / --coral tokens or its own rules loaded after ln.head. Bootstrap 5.3's CSS is loaded by
   ln.head on these pages too. */

/* ---------- Account / auth pages ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.25rem 3rem;
  background:
    radial-gradient(120% 120% at 100% 0%, var(--palm-soft, #e7efe9) 0%, transparent 55%),
    var(--bg, #fbf9f4);
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border: 1.5px solid var(--line, rgba(22, 25, 23, .12));
  border-radius: 22px;
  padding: 2.4rem 2.2rem;
  box-shadow: 0 30px 60px -40px rgba(20, 30, 24, .4);
}
.auth-card .overline { letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--palm, #1f5c43); font-size: .72rem; }
.auth-title { font-family: "Fraunces", serif; font-style: italic; font-weight: 400; font-size: 2rem; margin: .2rem 0 .3rem; }
.auth-sub { color: var(--muted, #777d77); margin-bottom: 1.4rem; }
.auth-field { margin-bottom: 1rem; }
.auth-field label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .35rem; }
.auth-pw { position: relative; }
.auth-pw .auth-eye { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted, #777d77); }
.auth-switch { text-align: center; margin-top: 1.3rem; color: var(--muted, #777d77); font-size: .9rem; }
.auth-switch a { color: var(--palm, #1f5c43); font-weight: 700; text-decoration: none; }
.auth-note { text-align: center; }
.auth-note .bi { font-size: 2.6rem; color: var(--palm, #1f5c43); }

/* My Account */
.account-orders { width: 100%; border-collapse: collapse; }
.account-orders th, .account-orders td { text-align: left; padding: .7rem .5rem; border-bottom: 1px solid var(--line, rgba(22, 25, 23, .12)); font-size: .9rem; }
.account-orders th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted, #777d77); }
.account-status { display: inline-block; padding: .12rem .6rem; border-radius: 50rem; font-size: .74rem; font-weight: 700; background: var(--palm-soft, #e7efe9); color: var(--palm, #1f5c43); }


/* Account hub: nav tabs, stat tiles, favorites grid, settings */
.account-nav { display: flex; flex-wrap: wrap; gap: .35rem; margin: 1.1rem 0 1.3rem; border-bottom: 1.5px solid var(--line, rgba(22, 25, 23, .12)); }
.account-nav a { padding: .55rem .9rem; font-size: .88rem; font-weight: 600; color: var(--muted, #777d77); text-decoration: none; border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; }
.account-nav a:hover { color: var(--ink, #161917); }
.account-nav a.active { color: var(--palm, #1f5c43); border-bottom-color: var(--palm, #1f5c43); }
.account-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; }
.account-tile { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; padding: .95rem 1rem; border: 1.5px solid var(--line, rgba(22, 25, 23, .12)); border-radius: 14px; text-decoration: none; color: var(--ink, #161917); transition: border-color .2s ease, box-shadow .2s ease; }
.account-tile:hover { border-color: var(--palm, #1f5c43); box-shadow: 0 0 0 3px var(--palm-soft, #e7efe9); color: var(--ink, #161917); }
.account-tile .bi { color: var(--palm, #1f5c43); font-size: 1.2rem; }
.account-tile strong { font-size: 1.4rem; line-height: 1.1; }
.account-tile span { font-size: .8rem; color: var(--muted, #777d77); font-weight: 600; }
.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem; }
.fav-card { border: 1.5px solid var(--line, rgba(22, 25, 23, .12)); border-radius: 14px; overflow: hidden; }
.fav-card.is-unavailable { opacity: .6; }
.fav-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #eee8df; }
.fav-body { padding: .75rem .9rem .9rem; display: grid; gap: .25rem; }
.settings-section { border-top: 1.5px solid var(--line, rgba(22, 25, 23, .12)); padding-top: 1.3rem; margin-top: 1.3rem; }
.settings-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.pref-list { display: grid; gap: .55rem; }
.pref-row { display: flex; gap: .75rem; align-items: flex-start; border: 1.5px solid var(--line, rgba(22, 25, 23, .12)); border-radius: 12px; padding: .7rem .9rem; margin: 0; cursor: pointer; }
.pref-row:has(input:checked) { border-color: var(--palm, #1f5c43); box-shadow: 0 0 0 3px var(--palm-soft, #e7efe9); }
.pref-row input { margin-top: .2rem; accent-color: var(--palm, #1f5c43); }
.pref-row span { display: grid; gap: .1rem; }
.pref-row small { color: var(--muted, #777d77); }

/* Saved addresses (account page grid + checkout chooser) */
.address-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem; }
.address-card {
  border: 1.5px solid var(--line, rgba(22, 25, 23, .12));
  border-radius: 14px;
  padding: .9rem 1rem;
}
.address-card.is-default { border-color: var(--palm, #1f5c43); box-shadow: 0 0 0 3px var(--palm-soft, #e7efe9); }
.address-chooser { display: grid; gap: .5rem; }
.address-choice {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  border: 1.5px solid var(--line, rgba(22, 25, 23, .12));
  border-radius: 12px;
  padding: .65rem .9rem;
  cursor: pointer;
  margin: 0;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.address-choice:has(input:checked) { border-color: var(--palm, #1f5c43); box-shadow: 0 0 0 3px var(--palm-soft, #e7efe9); }
.address-choice input { margin-top: .25rem; accent-color: var(--palm, #1f5c43); }


/* ---------- Checkout page ---------- */
.checkout-page { padding: 8.5rem 0 4rem; }
.checkout-title {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin: .35rem 0 1.2rem;
}
.checkout-heading {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: .9rem;
}
.checkout-section { margin-bottom: 2.2rem; }
.checkout-summary {
  background: #fff;
  border: 1.5px solid var(--line, rgba(22, 25, 23, .12));
  border-radius: 18px;
  padding: 1.4rem 1.5rem;
}
.checkout-promo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--palm, #1f5c43);
  padding: .3rem 0;
}
.checkout-totals {
  border-top: 1.5px solid var(--line, rgba(22, 25, 23, .12));
  margin-top: 1rem;
  padding-top: 1rem;
  display: grid;
  gap: .35rem;
}
.checkout-grand { font-size: 1.1rem; }
.checkout-ship-option {
  display: flex;
  align-items: center;
  gap: .7rem;
  border: 1.5px solid var(--line, rgba(22, 25, 23, .12));
  border-radius: 12px;
  padding: .7rem .95rem;
  margin-bottom: .55rem;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.checkout-ship-option:has(input:checked) {
  border-color: var(--palm, #1f5c43);
  box-shadow: 0 0 0 3px var(--palm-soft, #e7efe9);
}
.checkout-ship-option input { accent-color: var(--palm, #1f5c43); }
.checkout-ship-name { font-weight: 600; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.checkout-ship-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.checkout-ship-meta { font-size: .8rem; color: var(--bs-secondary-color); }
.checkout-ship-badge { font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: .1rem .45rem; border-radius: 999px; background: var(--sand, #f1e9dc); color: var(--ink, #1f1a17); }
.checkout-ship-badge.is-free { background: var(--palm, #2f6b4f); color: #fff; }
.checkout-ship-badge.is-fastest { background: var(--coral, #e0563c); color: #fff; }
.checkout-ship-price { margin-left: auto; font-weight: 700; white-space: nowrap; align-self: center; }
.checkout-ship-option.is-pending { opacity: .75; cursor: progress; }
.checkout-ship-skeleton { display: inline-block; width: 3.5rem; height: 1rem; border-radius: 6px; background: linear-gradient(90deg, rgba(0,0,0,.06) 25%, rgba(0,0,0,.12) 50%, rgba(0,0,0,.06) 75%); background-size: 200% 100%; animation: ship-shimmer 1.2s linear infinite; }
@keyframes ship-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .checkout-ship-skeleton { animation: none; } }
.checkout-line-unavailable { opacity: .55; }
.checkout-confirm { max-width: 900px; }
.checkout-confirm-icon {
  font-size: 3rem;
  color: var(--palm, #1f5c43);
  margin-bottom: .3rem;
}
.checkout-order-number { font-size: 1.05rem; }
.checkout-address { line-height: 1.5; }


/* ---- Checkout: the tax row fades in when a zone matches (docs/tax-plan.md §7) ---- */
.checkout-tax { opacity: 0; transform: translateY(-3px); transition: opacity .35s ease, transform .35s ease; }
.checkout-tax.is-shown { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .checkout-tax { transition: none; transform: none; opacity: 1; } }

/* ---------- Address fields (docs/destinations-plan.md §5) ---------- */
.address-fields [data-field] { will-change: transform; }
.form-label.is-required::after { content: " *"; color: var(--coral, #d9534f); }
.address-fields .address-hint { color: #b4532a; }
.address-fields .form-control.is-soft-invalid { border-color: #e0a58a; }
.checkout-dest { opacity: 0; transform: translateY(-3px); transition: opacity .35s ease, transform .35s ease; color: #b4532a; }
.checkout-dest.is-shown { opacity: 1; transform: none; }
.checkout-lang { display: inline-flex; border: 1.5px solid var(--line, rgba(22, 25, 23, .12)); border-radius: 999px; padding: 2px; gap: 2px; }
.checkout-lang button { border: 0; background: transparent; border-radius: 999px; padding: .15rem .7rem; font-size: .8rem; font-weight: 600; color: var(--ink, #161917); transition: background .25s ease, color .25s ease; }
.checkout-lang button.is-active { background: var(--ink, #161917); color: #fff; }
.checkout-page.is-switching main, .checkout-page .is-fading { transition: opacity .25s ease; }
.checkout-i18n-fade { animation: checkoutFade .45s ease; }
@keyframes checkoutFade { from { opacity: .35; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .address-fields [data-field] { transition: none !important; transform: none !important; }
  .checkout-dest { transition: none; transform: none; opacity: 1; }
  .checkout-i18n-fade { animation: none; }
}


.import-main { padding: 7rem 0 4rem; max-width: 640px; }
.import-card { background: #fff; border-radius: 22px; padding: 2rem; box-shadow: 0 12px 40px rgba(14,59,46,.08); }
.import-kicker { font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted, #777d77); margin-bottom: .25rem; }
.import-title { font-family: "Fraunces", serif; font-weight: 600; font-size: 2rem; margin-bottom: .5rem; }
.import-note { background: var(--surface, #f6eee2); border-radius: 14px; padding: .9rem 1rem; margin: 1rem 0; white-space: pre-line; }
.import-lines { display: flex; flex-direction: column; gap: .75rem; margin: 1.25rem 0; }
.import-line { display: flex; align-items: center; gap: .9rem; }
.import-line img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; background: var(--surface, #f6eee2); }
.import-line.is-gone { opacity: .55; }
.import-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }
