:root {
  color-scheme: light;
  --ink: #171310;
  --muted: #70675f;
  --line: #ded6cc;
  --paper: rgb(250, 244, 237);
  --panel: #ffffff;
  --soft: #f4eee7;
  --success: #1d6b42;
  --warning: #8a5710;
  --error: #9d2d2d;
  --font-sans: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100svh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.billing-shell {
  width: min(100%, 840px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 24px clamp(20px, 5vw, 48px) 20px;
  display: grid;
  align-content: start;
  gap: 24px;
}

.billing-header,
.account-toolbar,
.account-actions,
.boutique-heading,
.billing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-card {
  display: block;
  width: min(220px, 58vw);
}

.brand-wordmark {
  display: block;
  width: 100%;
  height: auto;
}

.header-link,
.public-footer a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.header-link:hover,
.public-footer a:hover {
  color: var(--ink);
}

.billing-intro,
.panel-heading,
.billing-form,
.billing-field,
.billing-account,
.boutique-list,
.boutique-card,
.billing-details,
.billing-empty {
  display: grid;
}

.billing-intro {
  gap: 8px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(32px, 6vw, 46px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

.billing-intro > p:last-child,
.panel-heading p,
.billing-empty p,
.boutique-copy,
.form-status {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.billing-panel,
.billing-account {
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.billing-panel {
  display: grid;
  gap: 24px;
}

.panel-heading,
.billing-form,
.billing-field {
  gap: 7px;
}

.billing-form {
  gap: 16px;
}

.billing-form label {
  display: grid;
  gap: 6px;
  color: #302b27;
  font-size: 14px;
  font-weight: 700;
}

.billing-form input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #cfc5ba;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.billing-form input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px rgb(23 19 16 / 10%);
}

.password-input {
  position: relative;
  display: block;
}

.password-input input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 30px;
  height: 30px;
  min-height: 0;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  appearance: none;
  transform: translateY(-50%);
}

.password-toggle img {
  width: 19px;
  height: 19px;
  pointer-events: none;
}

.password-toggle:focus-visible,
.text-button:focus-visible,
.primary-button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.primary-button {
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid var(--ink);
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.primary-button:hover:not(:disabled) {
  background: #302a26;
}

.text-button {
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.form-status {
  min-height: 22px;
}

.form-status[data-kind="error"] {
  color: var(--error);
}

.billing-banner {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--soft);
  color: #423b35;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.billing-banner[data-kind="success"] {
  border-color: #b9d7c6;
  background: #edf7f1;
  color: var(--success);
}

.billing-banner[data-kind="warning"] {
  border-color: #e0cba7;
  background: #fff8e9;
  color: var(--warning);
}

.billing-banner[data-kind="error"] {
  border-color: #e3bcbc;
  background: #fff0f0;
  color: var(--error);
}

.billing-account {
  gap: 24px;
}

.account-toolbar {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.account-email {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.account-actions {
  justify-content: flex-end;
}

.billing-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px 0;
  color: var(--muted);
}

.loading-indicator {
  width: 18px;
  height: 18px;
  border: 2px solid #d5ccc3;
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: billing-spin 0.8s linear infinite;
}

@keyframes billing-spin {
  to {
    transform: rotate(360deg);
  }
}

.boutique-list {
  gap: 14px;
}

.boutique-card {
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.boutique-heading {
  align-items: flex-start;
}

.boutique-heading h2 {
  overflow-wrap: anywhere;
}

.status-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: #4e463f;
  font-size: 12px;
  font-weight: 800;
}

.status-badge[data-tone="success"] {
  background: #e7f4ec;
  color: var(--success);
}

.status-badge[data-tone="warning"] {
  background: #fff2d8;
  color: var(--warning);
}

.status-badge[data-tone="error"] {
  background: #fde9e9;
  color: var(--error);
}

.billing-details {
  border-top: 1px solid var(--line);
}

.billing-row {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.billing-row span {
  color: var(--muted);
}

.billing-row strong {
  text-align: right;
}

.boutique-copy {
  font-size: 14px;
}

.billing-empty {
  gap: 8px;
  padding: 28px 4px;
  text-align: center;
}

.public-footer {
  margin-top: auto;
}

@media (max-width: 560px) {
  .billing-shell {
    padding-top: 18px;
    gap: 18px;
  }

  .billing-header {
    align-items: flex-start;
  }

  .brand-card {
    width: min(190px, 60vw);
  }

  .billing-panel,
  .billing-account {
    padding: 18px;
  }

  .boutique-heading {
    display: grid;
    gap: 8px;
  }

  .account-toolbar {
    align-items: flex-start;
  }

  .account-actions {
    display: grid;
    justify-items: end;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-indicator {
    animation: none;
  }
}
