/* ==========================================================================
   Beauty Diary — Corporate Brand Portal
   Main stylesheet
   --------------------------------------------------------------------------
   1. Design tokens
   2. Reset & base
   3. Typography
   4. Layout primitives
   5. Site header & footer (public pages)
   6. Buttons & links
   7. Forms
   8. App shell (signed-in pages)
   9. Components (panels, tables, badges, toasts, dialogs, empty states)
   10. Page-specific: home, auth, sign-up, portfolio, products
   11. Utilities
   12. Reduced motion & print
   ========================================================================== */

/* 1. Design tokens ------------------------------------------------------- */
:root {
  /* Colour */
  --color-bg: #000000;
  --color-surface: #121212;
  --color-surface-raised: #1c1c1c;
  --color-line: #2e2e2e;
  --color-line-strong: #4a4a4a;
  --color-text: #ffffff;
  --color-text-muted: #b3b3b3;      /* 9.6:1 on black */
  --color-accent: #f2b8c6;          /* powder blush */
  --color-accent-strong: #ffd6e0;
  --color-success: #9fe0b5;
  --color-warning: #f5d38a;
  --color-danger: #ff9b9b;
  --color-focus: #ffffff;

  /* Type */
  --font-display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --font-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;

  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1rem;
  --text-md: 1.25rem;
  --text-lg: 1.5625rem;
  --text-xl: 2.4375rem;
  --text-2xl: clamp(2.75rem, 6vw + 1rem, 5.5rem);

  --leading-tight: 1.1;
  --leading-body: 1.6;

  /* Space (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 7rem;

  /* Shape & motion */
  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-pill: 999px;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --duration: 180ms;

  --content-width: 72rem;
  --reading-width: 40rem;
  --sidebar-width: 15.5rem;

  color-scheme: dark;
}

/* 2. Reset & base -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

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

::selection { background: var(--color-accent); color: #000; }

/* 3. Typography ---------------------------------------------------------- */
h1, h2, h3, h4 {
  margin: 0 0 var(--space-4);
  line-height: var(--leading-tight);
  font-weight: 500;
}

h1, h2 { font-family: var(--font-display); letter-spacing: -0.01em; }
h1 { font-size: var(--text-xl); }
h2 { font-size: var(--text-lg); }
h3 { font-size: var(--text-md); font-weight: 600; }
h4 { font-size: var(--text-base); font-weight: 600; }

p { margin: 0 0 var(--space-4); max-width: var(--reading-width); }
small, .text-small { font-size: var(--text-sm); }
.text-muted { color: var(--color-text-muted); }

a { color: var(--color-text); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--color-accent-strong); }

/* 4. Layout primitives --------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.stack > * + * { margin-top: var(--space-4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--color-text);
  color: #000;
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: var(--space-4); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 5. Site header & footer ------------------------------------------------ */
.site-header {
  border-bottom: 1px solid var(--color-line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 4.5rem;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-style: italic;
  text-decoration: none;
  color: var(--color-text);
  white-space: nowrap;
}
.wordmark:hover { color: var(--color-text); }

.site-nav ul {
  display: flex;
  gap: var(--space-5);
  margin: 0; padding: 0;
  list-style: none;
  align-items: center;
}
.site-nav a:not(.btn) { text-decoration: none; color: var(--color-text-muted); }
.site-nav a:not(.btn):hover,
.site-nav a[aria-current="page"] { color: var(--color-text); }

.site-footer {
  margin-top: var(--space-9);
  border-top: 1px solid var(--color-line);
  padding-block: var(--space-6);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.site-footer .container {
  display: flex; flex-wrap: wrap; gap: var(--space-4);
  justify-content: space-between;
}
.site-footer ul { display: flex; gap: var(--space-5); list-style: none; margin: 0; padding: 0; }
.site-footer a { color: var(--color-text-muted); }

@media (max-width: 40rem) {
  .site-nav .nav-secondary { display: none; }
  .site-nav ul { gap: var(--space-3); }
}

/* 6. Buttons & links ----------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.75rem;               /* 44px touch target */
  padding: 0 var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--duration) var(--ease-out),
              border-color var(--duration) var(--ease-out),
              color var(--duration) var(--ease-out);
}
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--color-text); color: #000; }
.btn-primary:hover:not(:disabled) { background: var(--color-accent); color: #000; }

.btn-secondary { border-color: var(--color-line-strong); color: var(--color-text); background: transparent; }
.btn-secondary:hover:not(:disabled) { border-color: var(--color-text); color: var(--color-text); }

.btn-ghost { background: transparent; color: var(--color-text-muted); padding-inline: var(--space-3); }
.btn-ghost:hover:not(:disabled) { color: var(--color-text); }

.btn-danger { background: transparent; border-color: #6b3a3a; color: var(--color-danger); }
.btn-danger:hover:not(:disabled) { border-color: var(--color-danger); color: var(--color-danger); }

.btn-block { width: 100%; }

.btn[data-loading="true"]::after {
  content: "";
  width: 1em; height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 7. Forms --------------------------------------------------------------- */
.form { display: grid; gap: var(--space-5); }

.form-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}
.form-grid .span-full { grid-column: 1 / -1; }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; font-weight: 600; margin-bottom: var(--space-3); }

.field { display: grid; gap: var(--space-2); align-content: start; }

.field label, .field .label {
  font-size: var(--text-sm);
  font-weight: 600;
}
.field .optional { font-weight: 400; color: var(--color-text-muted); }

.hint { font-size: var(--text-xs); color: var(--color-text-muted); margin: 0; }

.input, .select, .textarea {
  width: 100%;
  min-height: 2.875rem;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  transition: border-color var(--duration) var(--ease-out);
}
.input::placeholder, .textarea::placeholder { color: #7a7a7a; }
.input:hover, .select:hover, .textarea:hover { border-color: #6a6a6a; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--color-text);
  box-shadow: 0 0 0 1px var(--color-text);
}
.textarea { min-height: 7.5rem; resize: vertical; }
.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: var(--space-7);
}

.field[data-invalid="true"] .input,
.field[data-invalid="true"] .select,
.field[data-invalid="true"] .textarea { border-color: var(--color-danger); }

.field-error {
  font-size: var(--text-xs);
  color: var(--color-danger);
  margin: 0;
}
.field-error:empty { display: none; }

.check {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: var(--space-3);
  align-items: start;
  font-size: var(--text-sm);
}
.check input {
  width: 1.25rem; height: 1.25rem;
  margin: 0.15rem 0 0;
  accent-color: var(--color-accent);
}

.choice-group { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.choice {
  position: relative;
}
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  transition: all var(--duration) var(--ease-out);
}
.choice input:checked + span { background: var(--color-text); color: #000; border-color: var(--color-text); }
.choice input:focus-visible + span { outline: 2px solid var(--color-focus); outline-offset: 3px; }

.form-alert {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-sm);
  color: var(--color-danger);
  font-size: var(--text-sm);
}
.form-alert[data-tone="info"] { border-color: var(--color-line-strong); color: var(--color-text); }

.password-wrap { position: relative; }
.password-wrap .input { padding-right: 5rem; }
.password-toggle {
  position: absolute; right: var(--space-2); top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--color-text-muted);
  font-size: var(--text-xs); font-weight: 600; cursor: pointer; padding: var(--space-2);
}
.password-toggle:hover { color: var(--color-text); }

/* File drop */
.dropzone {
  display: grid;
  place-items: center;
  gap: var(--space-2);
  padding: var(--space-6);
  border: 1px dashed var(--color-line-strong);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color var(--duration) var(--ease-out);
}
.dropzone:hover, .dropzone[data-dragging="true"] { border-color: var(--color-text); color: var(--color-text); }
.field label.dropzone { font-weight: 400; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone:focus-within { outline: 2px solid var(--color-focus); outline-offset: 3px; }

/* 8. App shell ----------------------------------------------------------- */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: var(--space-5);
  border-right: 1px solid var(--color-line);
}

.sidebar-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.sidebar-nav a {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
}
.sidebar-nav a:hover { color: var(--color-text); background: var(--color-surface); }
.sidebar-nav a[aria-current="page"] {
  color: var(--color-text);
  background: var(--color-surface-raised);
  box-shadow: inset 2px 0 0 var(--color-accent);
}

.sidebar-footer { margin-top: auto; display: grid; gap: var(--space-2); font-size: var(--text-sm); }
.sidebar-footer .user-name { font-weight: 600; }
.sidebar-footer .user-brand { color: var(--color-text-muted); font-size: var(--text-xs); }

.app-main { min-width: 0; padding: var(--space-6) var(--space-6) var(--space-8); }

.mobile-bar { display: none; }

@media (max-width: 56rem) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(18rem, 85vw);
    z-index: 50;
    background: var(--color-bg);
    transform: translateX(-100%);
    transition: transform 220ms var(--ease-out);
  }
  .sidebar[data-open="true"] { transform: none; }
  .mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--color-line);
    position: sticky; top: 0; z-index: 40;
    background: var(--color-bg);
  }
  .app-main { padding: var(--space-5) var(--space-5) var(--space-8); }
  .sidebar-scrim {
    position: fixed; inset: 0; z-index: 45; background: rgba(0,0,0,.7);
  }
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: end;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-line);
}
.page-header h1 { margin: 0; }
.page-header p { margin: var(--space-2) 0 0; color: var(--color-text-muted); }

/* 9. Components ---------------------------------------------------------- */
.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}
.panel + .panel { margin-top: var(--space-5); }
.panel-header {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.panel-header h2 { font-family: var(--font-body); font-size: var(--text-md); font-weight: 600; margin: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.15rem var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  border: 1px solid var(--color-line-strong);
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-published { color: var(--color-success); border-color: #2f5a3d; }
.badge-draft { color: var(--color-text-muted); }
.badge-pending { color: var(--color-warning); border-color: #5e4c24; }

.banner {
  display: flex; gap: var(--space-4); align-items: start;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-line-strong);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-6);
}
.banner p { margin: 0; }

.table-wrap { overflow-x: auto; border: 1px solid var(--color-line); border-radius: var(--radius-md); }
.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.data-table th, .data-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--color-line);
  vertical-align: middle;
}
.data-table th { font-weight: 600; color: var(--color-text-muted); background: var(--color-surface); white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--color-surface); }
.product-cell { display: flex; align-items: center; gap: var(--space-3); min-width: 14rem; }
.product-thumb {
  width: 3rem; height: 3rem; flex: none;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--color-surface-raised);
}
.product-cell a { font-weight: 600; text-decoration: none; }
.product-cell a:hover { text-decoration: underline; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
}
.stat { padding: var(--space-4) var(--space-5); border-right: 1px solid var(--color-line); }
.stat:last-child { border-right: 0; }
@media (max-width: 36rem) { .stat { border-right: 0; border-bottom: 1px solid var(--color-line); } .stat:last-child { border-bottom: 0; } }
.stat dt { font-size: var(--text-sm); color: var(--color-text-muted); }
.stat dd { margin: 0; font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.2; }

.empty-state {
  padding: var(--space-8) var(--space-5);
  text-align: center;
  border: 1px dashed var(--color-line-strong);
  border-radius: var(--radius-md);
}
.empty-state p { margin-inline: auto; color: var(--color-text-muted); }

.toast-region {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  z-index: 200;
  display: grid;
  gap: var(--space-2);
}
.toast {
  padding: var(--space-3) var(--space-5);
  background: var(--color-text);
  color: #000;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  animation: toast-in 200ms var(--ease-out);
}
.toast[data-tone="error"] { background: var(--color-danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

dialog {
  max-width: 28rem;
  width: calc(100% - 2rem);
  padding: var(--space-6);
  background: var(--color-surface-raised);
  color: var(--color-text);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-md);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.75); }
dialog h2 { font-size: var(--text-lg); }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.checklist li { display: flex; gap: var(--space-3); align-items: baseline; font-size: var(--text-sm); }
.checklist .mark {
  flex: none; width: 1.1rem; height: 1.1rem; border-radius: 50%;
  border: 1px solid var(--color-line-strong); transform: translateY(0.2rem);
}
.checklist li[data-done="true"] .mark { background: var(--color-accent); border-color: var(--color-accent); }
.checklist li[data-done="true"] .label { color: var(--color-text-muted); text-decoration: line-through; }

.split { display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr); }
@media (max-width: 64rem) { .split { grid-template-columns: minmax(0, 1fr); } }

/* 10. Page-specific ------------------------------------------------------ */

/* Home */
.hero {
  padding-block: var(--space-9) var(--space-8);
}
.hero h1 {
  font-size: var(--text-2xl);
  font-weight: 400;
  max-width: 17ch;
  margin-bottom: var(--space-5);
}
.hero-lede { font-size: var(--text-md); color: var(--color-text-muted); max-width: 34rem; margin-bottom: var(--space-6); }

.shade-strip {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  height: clamp(9rem, 22vw, 16rem);
  margin-top: var(--space-8);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.shade-strip span {
  position: relative;
  display: flex;
  align-items: end;
  padding: var(--space-3);
  font-size: var(--text-xs);
  color: rgba(0, 0, 0, 0.72);
  font-weight: 600;
  transform-origin: bottom;
  animation: shade-rise 700ms var(--ease-out) both;
}
.shade-strip span:nth-child(n+5) { color: rgba(255, 255, 255, 0.85); }
.shade-strip span:nth-child(2) { animation-delay: 60ms; }
.shade-strip span:nth-child(3) { animation-delay: 120ms; }
.shade-strip span:nth-child(4) { animation-delay: 180ms; }
.shade-strip span:nth-child(5) { animation-delay: 240ms; }
.shade-strip span:nth-child(6) { animation-delay: 300ms; }
.shade-strip span:nth-child(7) { animation-delay: 360ms; }
.shade-strip span:nth-child(8) { animation-delay: 420ms; }
@keyframes shade-rise { from { transform: scaleY(0); } }
@media (max-width: 40rem) {
  .shade-strip { grid-template-columns: repeat(4, 1fr); height: 14rem; }
  .shade-strip span:nth-child(n+5) { display: none; }
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: var(--space-6) var(--space-7);
  padding-block: var(--space-8);
  border-top: 1px solid var(--color-line);
}
.feature-list h2 { font-family: var(--font-body); font-size: var(--text-md); font-weight: 600; margin-bottom: var(--space-2); }
.feature-list p { color: var(--color-text-muted); margin: 0; }

.steps-section { padding-block: var(--space-8); border-top: 1px solid var(--color-line); }
.steps { list-style: none; counter-reset: step; margin: var(--space-6) 0 0; padding: 0; display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: 1;
  margin-bottom: var(--space-3);
  color: var(--color-accent);
}
.steps h3 { margin-bottom: var(--space-2); }
.steps p { color: var(--color-text-muted); margin: 0; }

/* Auth */
.auth-page { display: grid; min-height: 100vh; grid-template-rows: auto 1fr; }
.auth-main { display: grid; place-items: center; padding: var(--space-7) var(--space-5); }
.auth-card { width: 100%; max-width: 26rem; }
.auth-card h1 { margin-bottom: var(--space-2); }
.auth-card > p { color: var(--color-text-muted); }
.auth-alt { margin-top: var(--space-5); font-size: var(--text-sm); color: var(--color-text-muted); text-align: center; }
.demo-note {
  margin-top: var(--space-6);
  padding: var(--space-4);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.demo-note code { color: var(--color-text); }

/* Sign-up */
.signup-layout {
  display: grid;
  grid-template-columns: minmax(15rem, 20rem) minmax(0, 1fr);
  gap: var(--space-8);
  padding-block: var(--space-7);
  align-items: start;
}
@media (max-width: 56rem) { .signup-layout { grid-template-columns: 1fr; gap: var(--space-6); } }

.signup-aside { position: sticky; top: var(--space-6); }
@media (max-width: 56rem) { .signup-aside { position: static; } }
.signup-aside h1 { font-size: var(--text-xl); }

.verification-notice {
  margin-block: var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
}
.verification-notice h2 { font-family: var(--font-body); font-size: var(--text-base); font-weight: 600; margin-bottom: var(--space-2); color: var(--color-accent-strong); }
.verification-notice p { font-size: var(--text-sm); margin: 0; }

.progress { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); counter-reset: progress; }
.progress li {
  counter-increment: progress;
  display: flex; gap: var(--space-3); align-items: center;
  padding: var(--space-2) 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.progress li::before {
  content: counter(progress);
  display: grid; place-items: center;
  width: 1.75rem; height: 1.75rem; flex: none;
  border: 1px solid var(--color-line-strong);
  border-radius: 50%;
  font-size: var(--text-xs);
  font-weight: 600;
}
.progress li[aria-current="step"] { color: var(--color-text); font-weight: 600; }
.progress li[aria-current="step"]::before { background: var(--color-text); color: #000; border-color: var(--color-text); }
.progress li[data-complete="true"]::before { content: "✓"; border-color: var(--color-accent); color: var(--color-accent); }

.signup-step h2 { margin-bottom: var(--space-2); }
.signup-step > .step-intro { color: var(--color-text-muted); margin-bottom: var(--space-6); }
.step-actions {
  display: flex; justify-content: space-between; gap: var(--space-3);
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-line);
}

.review-list { display: grid; gap: var(--space-2) var(--space-5); grid-template-columns: max-content 1fr; margin: 0; font-size: var(--text-sm); }
.review-list dt { color: var(--color-text-muted); }
.review-list dd { margin: 0; word-break: break-word; }
@media (max-width: 36rem) { .review-list { grid-template-columns: 1fr; } .review-list dd { margin-bottom: var(--space-3); } }

.submitted {
  max-width: 38rem;
  margin: 0 auto;
  padding-block: var(--space-9) var(--space-7);
}
.submitted h1 { font-size: var(--text-2xl); font-weight: 400; }
.reference {
  display: inline-block;
  margin-block: var(--space-4) var(--space-6);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
}

/* Portfolio header (editor preview + public page) */
.portfolio-header {
  position: relative;
  display: grid;
  min-height: 22rem;
  padding: var(--space-7) var(--space-6);
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--header-bg, #1c1c1c);
  isolation: isolate;
}
.portfolio-header[data-height="compact"] { min-height: 14rem; }
.portfolio-header[data-height="tall"] { min-height: 32rem; }

.portfolio-header-image {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%;
  object-fit: cover;
}
.portfolio-header::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: #000;
  opacity: var(--header-overlay, 0.45);
}
.portfolio-header-inner {
  align-self: end;
  display: grid;
  gap: var(--space-3);
  justify-items: start;
  max-width: 44rem;
  color: var(--header-text, #fff);
}
.portfolio-header[data-align="center"] .portfolio-header-inner { justify-self: center; text-align: center; justify-items: center; align-self: center; }
.portfolio-header[data-align="right"] .portfolio-header-inner { justify-self: end; text-align: right; justify-items: end; }

.portfolio-logo {
  width: 4.5rem; height: 4.5rem;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.08);
}
.portfolio-header h1 {
  margin: 0;
  font-size: clamp(2.25rem, 5vw + 0.5rem, 4.5rem);
  font-weight: 400;
  color: inherit;
}
.portfolio-header .tagline { margin: 0; font-size: var(--text-md); opacity: 0.9; max-width: 36rem; }
.portfolio-header .header-cta { margin-top: var(--space-3); }

.editor-preview-label { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-2); }

.range-row { display: flex; align-items: center; gap: var(--space-3); }
.range-row input[type="range"] { flex: 1; accent-color: var(--color-accent); }
.range-row output { min-width: 3ch; font-size: var(--text-sm); }

.color-row { display: flex; align-items: center; gap: var(--space-3); }
.color-row input[type="color"] {
  width: 2.875rem; height: 2.875rem; padding: 0;
  border: 1px solid var(--color-line-strong); border-radius: var(--radius-sm);
  background: none; cursor: pointer;
}

/* Public portfolio */
.portfolio-page .portfolio-header { border-radius: 0; }
.portfolio-section { padding-block: var(--space-8); border-bottom: 1px solid var(--color-line); }
.portfolio-section:last-of-type { border-bottom: 0; }
.portfolio-about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--space-7); }
@media (max-width: 48rem) { .portfolio-about { grid-template-columns: 1fr; gap: var(--space-4); } }
.portfolio-about h2 { font-size: var(--text-xl); }
.brand-facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-5); margin: var(--space-5) 0 0; font-size: var(--text-sm); }
.brand-facts dt { color: var(--color-text-muted); }
.brand-facts dd { margin: 0; }

.product-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: var(--space-7) var(--space-5);
  margin-top: var(--space-6);
}
.showcase-item img, .showcase-item .img-placeholder {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  background: var(--color-surface);
  margin-bottom: var(--space-3);
}
.showcase-item h3 { font-size: var(--text-base); margin-bottom: var(--space-1); }
.showcase-item .meta { font-size: var(--text-sm); color: var(--color-text-muted); margin: 0; }
.showcase-item .swatches { margin-top: var(--space-2); }

.swatches { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.swatch-dot {
  width: 1rem; height: 1rem; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
}

/* Product editor */
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: var(--space-3); margin-top: var(--space-4); }
.image-tile { position: relative; }
.image-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); }
.image-tile .remove {
  position: absolute; top: var(--space-1); right: var(--space-1);
  width: 1.75rem; height: 1.75rem;
  border-radius: 50%; border: 0;
  background: rgba(0,0,0,0.8); color: #fff; cursor: pointer;
}
.image-tile .primary-label {
  position: absolute; left: var(--space-1); bottom: var(--space-1);
  padding: 0 var(--space-2); font-size: 0.6875rem; font-weight: 600;
  background: #fff; color: #000; border-radius: var(--radius-sm);
}

.shade-rows { display: grid; gap: var(--space-3); }
.shade-row { display: grid; grid-template-columns: 2.875rem 1fr 7rem 2.75rem; gap: var(--space-2); align-items: center; }
.shade-row input[type="color"] {
  width: 2.875rem; height: 2.875rem; padding: 0; border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-sm); background: none; cursor: pointer;
}

.sticky-actions {
  position: sticky; bottom: 0;
  display: flex; justify-content: flex-end; gap: var(--space-3); flex-wrap: wrap;
  margin-top: var(--space-6);
  padding: var(--space-4) 0;
  background: linear-gradient(to top, #000 70%, transparent);
}

.filters { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-5); }
.filters .field { min-width: 12rem; }
.filters .search { flex: 1; min-width: 14rem; }

/* 404 */
.not-found { padding-block: var(--space-9); }
.not-found h1 { font-size: var(--text-2xl); font-weight: 400; }

/* 11. Utilities ---------------------------------------------------------- */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }

/* 12. Reduced motion & print -------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  body { background: #fff; color: #000; }
  .sidebar, .mobile-bar, .site-header, .site-footer, .sticky-actions, .btn { display: none !important; }
  .app-shell { display: block; }
}
