:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-soft: #f0f2f2;
  --text: #111827;
  --muted: #5f6b7a;
  --border: #d5d9d9;
  --accent: #ff9900;
  --accent-dark: #d97706;
  --accent-soft: #fff4d6;
  --ink: #232f3e;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --focus: #146eb4;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

button,
input {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  transform: translateY(-150%);
  background: var(--ink);
  color: #fff;
  padding: 0.65rem 0.9rem;
  border-radius: 6px;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--ink);
  color: #fff;
  border-bottom: 3px solid var(--accent);
}

.header-shell {
  width: min(1120px, calc(100% - 2rem));
  min-height: 4.25rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
}

.brand {
  justify-self: center;
  text-decoration: none;
  font-weight: 800;
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.home-link {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.inline-form {
  margin: 0;
}

.link-button {
  border: 0;
  background: transparent;
  color: #f3f4f6;
  padding: 0.35rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.landing {
  min-height: calc(100vh - 4rem);
  display: grid;
  align-items: center;
}

.landing-copy {
  max-width: 680px;
}

.eyebrow,
.step-label {
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(2.2rem, 7vw, 4.8rem);
  line-height: 1.02;
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  line-height: 1.2;
}

.lead {
  max-width: 44rem;
  color: var(--muted);
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  margin: 1rem 0 1.5rem;
}

.muted {
  color: var(--muted);
}

.button {
  min-height: 2.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.72rem 1rem;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  border-color: var(--accent-dark);
  color: #111827;
}

.button-primary:hover {
  background: #f3a51c;
}

.button-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.button-secondary:hover {
  background: var(--surface-soft);
}

.button-danger {
  background: var(--danger-soft);
  border-color: #f0b8b2;
  color: var(--danger);
}

.button-danger:hover {
  background: #ffe2df;
}

.button-small,
.button-compact {
  min-height: 2.25rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.92rem;
}

.action-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.flash-stack {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.flash,
.form-error {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 700;
}

.flash-success {
  background: #effaf2;
  border-color: #acd7b8;
}

.flash-error,
.form-error {
  background: var(--danger-soft);
  border-color: #f0b8b2;
  color: var(--danger);
}

.flash-info {
  background: #edf6ff;
  border-color: #b8d9f6;
}

.auth-panel,
.flow-panel,
.empty-state,
.settings-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.06);
}

.auth-panel,
.flow-panel {
  width: min(560px, 100%);
  margin: 3rem auto;
  padding: clamp(1.25rem, 4vw, 2rem);
}

.auth-panel h1,
.flow-panel h1,
.section-header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}

.form-stack {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  font-weight: 800;
}

.field input {
  min-height: 2.85rem;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  background: #fff;
  color: var(--text);
}

.auth-switch {
  margin: 1.25rem 0 0;
}

.auth-switch a,
.url-line a {
  color: var(--focus);
  font-weight: 800;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin: 0 0 1.5rem;
}

.empty-state {
  text-align: center;
  padding: clamp(2rem, 6vw, 4rem);
}

.empty-state .button {
  margin-top: 1rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1rem;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
  display: grid;
  grid-template-rows: auto 1fr;
}

.product-image-link {
  display: block;
  background: var(--surface-soft);
}

.product-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  padding: 1rem;
}

.product-card-body {
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

.product-card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.product-card h2 a {
  text-decoration: none;
}

.product-card h2 a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.price-list,
.summary-list {
  display: grid;
  gap: 0.7rem;
  margin: 0;
}

.price-list div,
.summary-list div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: baseline;
  border-top: 1px solid var(--border);
  padding-top: 0.7rem;
}

.price-list dt,
.summary-list dt {
  color: var(--muted);
  font-weight: 700;
}

.price-list dd,
.summary-list dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

.card-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.card-actions form {
  margin: 0;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: 1.25rem;
  align-items: start;
}

.detail-media,
.detail-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
}

.detail-media {
  padding: 1rem;
}

.detail-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

.detail-content {
  padding: clamp(1rem, 3vw, 1.5rem);
  display: grid;
  gap: 1rem;
}

.url-line {
  margin: 0;
  word-break: break-word;
}

.compact-form {
  max-width: 360px;
}

.delete-form {
  margin: 0;
}

.confirm-product,
.summary-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  align-items: center;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.confirm-image {
  width: 120px;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.summary-card {
  grid-template-columns: 140px 1fr;
}

.break-word {
  word-break: break-word;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1rem;
}

.settings-panel {
  padding: clamp(1rem, 3vw, 1.5rem);
}

.account-email {
  display: inline-flex;
  max-width: 100%;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  background: var(--accent-soft);
  font-weight: 800;
  word-break: break-word;
}

@media (max-width: 760px) {
  .header-shell {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0.75rem 0;
  }

  .header-actions {
    justify-content: center;
  }

  .page-shell {
    width: min(100% - 1rem, 1120px);
    padding-top: 1rem;
  }

  .section-header,
  .detail-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .section-header .button {
    justify-self: start;
  }

  .confirm-product,
  .summary-card {
    grid-template-columns: 1fr;
  }

  .price-list div,
  .summary-list div {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .price-list dd,
  .summary-list dd {
    text-align: left;
  }

  .button {
    width: 100%;
  }

  .action-row,
  .card-actions {
    align-items: stretch;
  }

  .card-actions form,
  .card-actions button {
    width: 100%;
  }
}
