@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

[hidden] { display: none !important; }

/* ── Tokens ── */
:root {
  --background:          #ffffff;
  --foreground:          #09090b;
  --muted:               #f4f4f5;
  --muted-fg:            #71717a;
  --border:              #e4e4e7;
  --input:               #e4e4e7;
  --primary:             #18181b;
  --primary-fg:          #fafafa;
  --secondary:           #f4f4f5;
  --secondary-fg:        #18181b;
  --destructive:         #ef4444;
  --destructive-fg:      #fafafa;
  --ok:                  #16a34a;
  --ring:                #18181b;
  --brand:               #2563eb;
  --brand-2:             #7c3aed;
  --radius:              0.5rem;
  --shadow-sm:           0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow:              0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
  --shadow-md:           0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Nav ── */
nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2.5rem; height: 3.5rem;
  background: rgba(255 255 255 / .9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-size: 1rem; font-weight: 700; letter-spacing: -.02em;
  color: var(--foreground); text-decoration: none;
}
.nav-logo span { color: var(--brand); }

.nav-links { display: flex; gap: 1.5rem; list-style: none; }
.nav-links a {
  color: var(--muted-fg); text-decoration: none; font-size: .875rem;
  font-weight: 500; transition: color .15s;
}
.nav-links a:hover { color: var(--foreground); }

.nav-track-link {
  color: var(--muted-fg); text-decoration: none; font-size: .875rem;
  font-weight: 500; transition: color .15s; white-space: nowrap;
}
.nav-track-link:hover { color: var(--foreground); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .5rem 1rem; border-radius: var(--radius);
  font-size: .875rem; font-weight: 500; line-height: 1;
  text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
  border: 1px solid transparent; white-space: nowrap; user-select: none;
}
.btn-primary {
  background: var(--primary); color: var(--primary-fg);
  border-color: var(--primary);
}
.btn-primary:hover { background: #3f3f46; border-color: #3f3f46; }

.btn-outline {
  background: var(--background); color: var(--foreground);
  border-color: var(--border);
}
.btn-outline:hover { background: var(--muted); }

.btn-destructive {
  background: var(--destructive); color: var(--destructive-fg);
  border-color: var(--destructive);
}
.btn-destructive:hover { background: #dc2626; border-color: #dc2626; }

.btn-white {
  background: var(--background); color: var(--primary);
  border-color: var(--background);
}
.btn-white:hover { background: var(--muted); }

.btn-large { padding: .625rem 1.25rem; font-size: .9375rem; }

.btn[disabled], button[disabled] { opacity: .5; pointer-events: none; }

/* ── Layout ── */
.wrap { max-width: 1100px; margin: 0 auto; padding: 3rem 2.5rem 5rem; }

h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800;
     letter-spacing: -.025em; margin-bottom: .5rem; }
.lead { color: var(--muted-fg); font-size: 1rem; margin-bottom: 2rem; max-width: 60ch; }

/* ── Dropzone ── */
.dropzone {
  border: 1px dashed var(--border); border-radius: var(--radius);
  background: var(--muted); padding: 3rem 2rem; text-align: center;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--primary); background: var(--background);
}
.dropzone .big { font-size: 2rem; margin-bottom: .75rem; }
.dropzone h2 { font-size: 1rem; font-weight: 600; margin-bottom: .25rem; }
.dropzone p  { color: var(--muted-fg); font-size: .875rem; }
.dropzone .browse { color: var(--brand); font-weight: 500; }

/* ── Toolbar ── */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin: 2rem 0 1rem;
}
.summary { color: var(--muted-fg); font-size: .875rem; }
.summary b { color: var(--foreground); font-weight: 600; }

/* ── Photo grid ── */
.grid {
  display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.item {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--background);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s;
}
.item:hover { box-shadow: var(--shadow); }

.thumb {
  width: 100%; height: 170px; object-fit: contain; display: block;
  background: var(--muted);
}
.thumb.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-fg); font-size: .8rem; text-align: center; padding: .5rem;
}

.meta { padding: .5rem .625rem .625rem; }

.name-row {
  display: flex; align-items: center; gap: .35rem; min-width: 0;
}
.name {
  font-size: .8rem; font-weight: 500; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; min-width: 0;
}

.status { font-size: .75rem; margin-top: .2rem; color: var(--muted-fg); }
.status.up   { color: var(--brand); }
.status.done { color: var(--ok); }
.status.err  { color: var(--destructive); }

.bar {
  height: 3px; background: var(--border); border-radius: 9999px;
  overflow: hidden; margin-top: .4rem;
}
.bar > span {
  display: block; height: 100%; width: 0;
  background: var(--primary); transition: width .15s;
}

.remove {
  background: none; border: none; padding: 0; margin-left: auto;
  color: var(--muted-fg); font-size: 1rem; cursor: pointer; line-height: 1;
  flex-shrink: 0; transition: color .15s;
}
.remove:hover { color: var(--destructive); }

.empty { color: var(--muted-fg); font-size: .9rem; padding: 2rem 0; }

/* ── Hero ── */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  padding: 6rem 2.5rem 5rem;
  max-width: 1200px; margin: 0 auto;
}

.hero-copy h1 {
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  font-weight: 800; letter-spacing: -.03em; line-height: 1.1;
  margin-bottom: 1.25rem;
}
.hero-copy h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-copy p {
  font-size: 1.0625rem; color: var(--muted-fg);
  max-width: 42ch; margin-bottom: 2rem;
}
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* Animated collage assembly (hero) */
.hero-collage {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

/* ── Trust band ── */
.band {
  background: var(--foreground); color: var(--primary-fg);
  text-align: center; padding: .875rem 2.5rem;
  font-size: .8125rem; font-weight: 500; letter-spacing: .04em;
}
.band .sep { opacity: .4; margin: 0 1.25rem; }

/* ── Sections ── */
.section { max-width: 1200px; margin: 0 auto; padding: 5rem 2.5rem; }

.section-label {
  font-size: .75rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted-fg); margin-bottom: .6rem;
}
.section-title {
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 800; letter-spacing: -.025em; margin-bottom: 1rem;
}
.section-sub {
  font-size: 1rem; color: var(--muted-fg); max-width: 52ch;
  margin-bottom: 3rem;
}

/* ── Feature cards ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--background); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.card-icon {
  width: 40px; height: 40px; border-radius: calc(var(--radius) - 2px);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; margin-bottom: 1rem;
}
.icon-blue   { background: #dbeafe; }
.icon-violet { background: #ede9fe; }
.icon-green  { background: #d1fae5; }
.icon-orange { background: #ffedd5; }
.icon-pink   { background: #fce7f3; }
.icon-teal   { background: #ccfbf1; }

.card h3 { font-size: .9375rem; font-weight: 600; margin-bottom: .375rem; }
.card p  { font-size: .875rem; color: var(--muted-fg); line-height: 1.65; }

/* ── Steps ── */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.step { text-align: center; }
.step-num {
  width: 48px; height: 48px; border-radius: 9999px;
  background: var(--primary); color: var(--primary-fg);
  font-size: 1.125rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
}
.step h3 { font-size: .9375rem; font-weight: 600; margin-bottom: .375rem; }
.step p  { font-size: .875rem; color: var(--muted-fg); }

/* ── CTA ── */
.cta-section {
  background: var(--foreground); color: var(--primary-fg);
  text-align: center; padding: 5rem 2.5rem;
}
.cta-section h2 {
  font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 800;
  letter-spacing: -.025em; margin-bottom: .875rem;
}
.cta-section p {
  font-size: 1rem; opacity: .7; margin-bottom: 2rem;
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2.5rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
  font-size: .8125rem; color: var(--muted-fg);
}
footer a { color: var(--muted-fg); text-decoration: none; transition: color .15s; }
footer a:hover { color: var(--foreground); }
.footer-links { display: flex; gap: 1.5rem; }

/* ── Admin nav links (injected into main nav by settings.js) ── */
.nav-admin-links {
  display: flex;
  gap: .125rem;
}
.nav-admin-link {
  font-size: .8125rem;
  font-weight: 500;
  padding: .375rem .75rem;
  border-radius: var(--radius);
  color: var(--muted-fg);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.nav-admin-link:hover  { color: var(--foreground); background: var(--muted); }
.nav-admin-link.active { color: var(--foreground); font-weight: 600; }

/* ── Step progress indicator (order flow & collage flow) ── */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
}
.step-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1;
}
.step-item:last-child { flex: 0; }
.step-num {
  width: 1.75rem; height: 1.75rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--background);
  color: var(--muted-fg);
  font-size: .75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step-label {
  font-size: .8125rem; font-weight: 500; color: var(--muted-fg);
  white-space: nowrap;
}
.step-line {
  flex: 1; height: 2px; background: var(--border); margin: 0 .5rem;
}
.step-item.active   .step-num   { border-color: var(--brand); background: var(--brand); color: #fff; }
.step-item.active   .step-label { color: var(--foreground); }
.step-item.done     .step-num   { border-color: var(--brand); background: var(--brand); color: #fff; }
.step-line.done { background: var(--brand); }

/* navigable steps — clickable names show as dark-blue links */
.step-item.clickable { cursor: pointer; }
.step-item.clickable .step-label { color: #1d4ed8; }
.step-item.clickable:hover .step-label { text-decoration: underline; }
.step-item.clickable:hover .step-num   { border-color: var(--brand); }
.step-item.disabled  { cursor: not-allowed; opacity: .5; }

/* collage-flow stepper: sits between nav and page content */
.collage-stepper-wrap {
  max-width: 680px;
  margin: 1.25rem auto 0;
  padding: 0 2rem;
}

/* back/forward nav row directly below the stepper */
.step-nav {
  max-width: 680px;
  margin: .75rem auto 1.25rem;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 480px) {
  .step-label { display: none; }
}

/* ── User menu button & dropdown ── */
.user-menu-btn {
  background: none; border: none; cursor: pointer;
  font-size: .875rem; font-weight: 500;
  color: var(--foreground);
  padding: .35rem .625rem;
  border-radius: var(--radius);
  display: flex; align-items: center; gap: .35rem;
  line-height: 1; white-space: nowrap;
  transition: background .15s;
  flex-shrink: 0;
}
/* ── Base / size management (partner-bases.js) ── */
.medium-block {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--background); margin-bottom: .75rem; overflow: hidden;
}
.medium-block.inactive { opacity: .6; }
.medium-head { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; flex-wrap: wrap; }
.medium-head-info { flex: 1 1 auto; min-width: 0; }
.medium-name { font-size: .9rem; font-weight: 600; }
.medium-spec {
  font-size: .75rem; color: var(--muted-fg); margin-top: .15rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50ch;
}
.medium-actions { display: flex; gap: .35rem; flex-shrink: 0; }
.sizes-section { border-top: 1px solid var(--border); padding: .75rem 1rem; background: var(--muted); }
.size-row {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .4rem .5rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--background); margin-bottom: .35rem;
}
.size-row.inactive { opacity: .55; }
.size-info  { flex: 1 1 auto; min-width: 0; font-size: .8125rem; }
.size-price { font-size: .8125rem; font-weight: 600; flex-shrink: 0; color: var(--muted-fg); }
.size-actions { display: flex; gap: .3rem; flex-shrink: 0; }
.inline-form {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: .875rem 1rem; margin-top: .5rem; background: var(--background);
}
.inline-form h4 { font-size: .8125rem; font-weight: 600; margin-bottom: .75rem; }

.user-menu-btn[hidden] { display: none; }
.user-menu-btn:hover, .user-menu-btn.active { background: var(--muted); }
.user-menu-btn::after {
  content: '';
  display: inline-block;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  opacity: .5;
}

.user-menu-panel {
  position: fixed;
  z-index: 500;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 160px;
  overflow: hidden;
}

/* ── Settings modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(0 0 0 / .45);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-overlay[hidden] { display: none; }
.modal-box {
  background: var(--background);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0 0 0 / .25);
  width: 100%; max-width: 480px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h2 { font-size: 1rem; font-weight: 600; margin: 0; }
.modal-close-btn {
  background: none; border: none; cursor: pointer;
  font-size: 1.25rem; line-height: 1;
  color: var(--muted-fg); padding: .25rem .375rem;
  border-radius: var(--radius);
  transition: color .15s, background .15s;
}
.modal-close-btn:hover { color: var(--foreground); background: var(--muted); }
.modal-body { overflow-y: auto; padding: 1.25rem; flex: 1; }
.modal-section { margin-bottom: 1.5rem; }
.modal-section:last-child { margin-bottom: 0; }
.modal-section-title {
  font-size: .875rem; font-weight: 600;
  margin-bottom: .875rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
}
.modal-field { margin-bottom: .875rem; }
.modal-field:last-of-type { margin-bottom: 0; }
.modal-field label {
  display: block; font-size: .8rem; font-weight: 500;
  color: var(--muted-fg); margin-bottom: .3rem;
}
.modal-field input {
  width: 100%; padding: .4rem .65rem; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .875rem; font-family: inherit;
  background: var(--background); color: var(--foreground);
  transition: border-color .15s;
}
.modal-field input:focus { outline: none; border-color: var(--ring); }
.modal-field input[readonly] { background: var(--muted); color: var(--muted-fg); cursor: default; }
.modal-field-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: .875rem;
}
@media (max-width: 440px) { .modal-field-row { grid-template-columns: 1fr; } }
.modal-form-actions {
  display: flex; align-items: center; gap: .75rem; margin-top: 1rem;
}
.modal-form-status { font-size: .8rem; }
.modal-form-status.ok  { color: #16a34a; }
.modal-form-status.err { color: var(--destructive); }

/* ── Settings button & panel ── */
.settings-btn {
  background: none; border: none; cursor: pointer;
  color: var(--muted-fg); padding: .35rem;
  border-radius: var(--radius);
  display: flex; align-items: center; line-height: 1;
  transition: color .15s, background .15s;
  flex-shrink: 0;
}
.settings-btn:hover, .settings-btn.active { color: var(--foreground); background: var(--muted); }

.settings-panel {
  position: fixed;
  top: 3.75rem;
  right: .75rem;
  z-index: 500;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 180px;
  overflow: hidden;
}

.settings-section-btn {
  width: 100%; display: flex; align-items: center;
  justify-content: space-between; gap: .5rem;
  padding: .625rem 1rem;
  background: none; border: none; cursor: pointer;
  font-size: .875rem; font-weight: 500; font-family: inherit;
  color: var(--foreground); text-align: left;
  transition: background .1s;
}
.settings-section-btn:hover { background: var(--muted); }

.settings-arrow {
  font-size: .75rem; color: var(--muted-fg);
  display: inline-block; transition: transform .15s;
}
.settings-section-btn.open .settings-arrow { transform: rotate(90deg); }

.settings-lang-list {
  border-top: 1px solid var(--border);
  padding: .25rem 0;
}

.lang-option {
  width: 100%; display: flex; align-items: center;
  padding: .45rem 1rem .45rem 2.25rem;
  background: none; border: none; cursor: pointer;
  font-size: .875rem; font-family: inherit;
  color: var(--foreground); text-align: left;
  transition: background .1s;
  position: relative;
}
.lang-option:hover { background: var(--muted); }
.lang-option.active { font-weight: 600; }
.lang-option.active::before {
  content: '✓';
  position: absolute; left: .875rem;
  font-size: .75rem; color: var(--primary);
}

.settings-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: .25rem 0;
}
.settings-user {
  padding: .5rem 1rem .25rem;
  font-size: .75rem;
  color: var(--muted-fg);
}
.settings-user strong {
  display: block;
  font-size: .8125rem;
  color: var(--foreground);
  font-weight: 600;
  margin-bottom: .1rem;
}
.settings-link {
  width: 100%; display: flex; align-items: center;
  padding: .45rem 1rem;
  background: none; border: none; cursor: pointer;
  font-size: .875rem; font-family: inherit;
  color: var(--foreground); text-align: left;
  text-decoration: none;
  transition: background .1s;
}
.settings-link:hover { background: var(--muted); }

/* ── Responsive ── */
@media (max-width: 768px) {
  nav { padding: 0 1.25rem; }
  .nav-links { display: none; }
  .hero {
    grid-template-columns: 1fr;
    padding: 3rem 1.25rem;
    gap: 2.5rem;
  }
  .section { padding: 3.5rem 1.25rem; }
  .wrap { padding: 2rem 1.25rem 4rem; }
  footer { flex-direction: column; align-items: flex-start; }
}
