/* LayerLab 3D design system
   Shared by the public website and the customer portal.
   Light mode only. Tokens first, then reset, type, controls and small shared parts. */

:root {
  --paper: #ffffff;
  --warm: #f6f4ef;
  --warm-2: #edeae2;
  --ink: #1d1e22;
  --ink-2: #4b4d55;
  --ink-3: #686a73;
  --line: #e4e1d9;
  --line-2: #d1cdc1;
  --blue: #3052cf;
  --blue-ink: #2543b0;
  --blue-tint: #ecf0fd;
  --blue-line: #c8d2f5;
  --ok: #256b4b;
  --ok-tint: #e5f1ea;
  --warn: #8a5a10;
  --warn-tint: #faefd9;
  --err: #a93425;
  --err-tint: #fbe8e5;

  --font-display: "Bricolage Grotesque", "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --font-body: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-sm: 4px;
  --r: 6px;
  --r-lg: 10px;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.5, 1);
  --wrap: 1240px;
  --gutter: clamp(20px, 4vw, 48px);
  color-scheme: light;
}

@supports (transition-timing-function: linear(0, 1)) {
  :root { --spring: linear(0, 0.18 5%, 0.58 14%, 0.9 26%, 1.04 38%, 1.05 48%, 1.01 66%, 1); }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

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

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-wrap: balance;
}
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }

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

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mono { font-family: var(--font-mono); font-feature-settings: "zero" 1; }
.muted { color: var(--ink-3); }
.skip-link { position: absolute; left: 16px; top: -64px; z-index: 200; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r); transition: top 0.15s; }
.skip-link:focus { top: 12px; }

/* Wordmark */
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 650 1.25rem/1 var(--font-display); letter-spacing: -0.035em; color: var(--ink); }
.wordmark svg { width: 28px; height: 28px; flex: none; }
.wordmark__3d { font: 500 0.625rem/1 var(--font-mono); letter-spacing: 0.02em; color: var(--blue-ink); background: var(--blue-tint); border: 1px solid var(--blue-line); border-radius: 3px; padding: 3px 4px; transform: translateY(-5px); margin-left: -4px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--r);
  border: 1px solid transparent; background: var(--ink); color: #fff;
  font-weight: 500; font-size: 0.9375rem; line-height: 1; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s var(--ease), box-shadow 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.97); transition-duration: 0.08s; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--accent { background: var(--blue); }
.btn--accent:hover { background: var(--blue-ink); }
.btn--dark:hover { background: #000; }
.btn--secondary { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn--secondary:hover { border-color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--warm); }
.btn--lg { min-height: 52px; padding: 0 24px; font-size: 1rem; }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 0.875rem; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.link { color: var(--blue-ink); text-decoration: underline; text-decoration-color: var(--blue-line); text-underline-offset: 3px; text-decoration-thickness: 1.5px; transition: text-decoration-color 0.15s; }
.link:hover { text-decoration-color: currentColor; }
.link-btn { background: none; border: 0; padding: 0; color: var(--blue-ink); text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Forms */
.field { display: grid; gap: 6px; align-content: start; }
.field > label, .label { font-size: 0.875rem; font-weight: 500; color: var(--ink); }
.field .opt { color: var(--ink-3); font-weight: 400; }
.hint { font-size: 0.8125rem; color: var(--ink-3); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; color: var(--ink);
  font-size: 0.9375rem; line-height: 1.4;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { min-height: 116px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%234B4D55' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.input:hover, .select:hover, .textarea:hover { border-color: #b4af9f; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(48, 82, 207, 0.2); }
.input::placeholder, .textarea::placeholder { color: #8d8f97; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--err); }
.field.has-error .input:focus-visible, .field.has-error .textarea:focus-visible, .field.has-error .select:focus-visible { box-shadow: 0 0 0 3px rgba(169, 52, 37, 0.18); }
.error-msg { display: none; align-items: flex-start; gap: 6px; color: var(--err); font-size: 0.8125rem; font-weight: 500; line-height: 1.35; }
.error-msg svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.field.has-error > .error-msg, .has-error .error-msg { display: flex; }
.form-grid { display: grid; gap: 20px; }
@media (min-width: 640px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: 1 / -1; } }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-weight: 500; font-size: 0.875rem; margin-bottom: 8px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9375rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--blue); flex: none; }

/* Inline notices */
.note { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--blue-line); background: var(--blue-tint); border-radius: var(--r); font-size: 0.875rem; color: var(--ink); line-height: 1.5; }
.note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--blue-ink); }
.note--warn { border-color: #ecd49e; background: var(--warn-tint); }
.note--warn svg { color: var(--warn); }
.note--ok { border-color: #b9dbc9; background: var(--ok-tint); }
.note--ok svg { color: var(--ok); }
.note--err { border-color: #efc0b8; background: var(--err-tint); }
.note--err svg { color: var(--err); }
.note strong { font-weight: 600; }

/* Status badges */
.badge { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 0.8125rem; font-weight: 500; line-height: 1.4; background: #efede7; color: #3f4149; white-space: nowrap; }
.badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--blue { background: var(--blue-tint); color: var(--blue-ink); }
.badge--ok { background: var(--ok-tint); color: var(--ok); }
.badge--warn { background: var(--warn-tint); color: var(--warn); }
.badge--err { background: var(--err-tint); color: var(--err); }

/* Progress bar */
.bar { height: 6px; border-radius: 3px; background: var(--warm-2); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: var(--blue); border-radius: inherit; transition: width 0.5s var(--ease); }

/* Image placeholder that echoes printed layers, shown if a photo fails to load */
.ph { background: repeating-linear-gradient(0deg, var(--warm-2) 0 7px, var(--warm) 7px 8px); }
img.is-broken { opacity: 0; }

/* Toast */
.toast-region { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; background: var(--ink); color: #fff; padding: 12px 14px; border-radius: var(--r); font-size: 0.9375rem; box-shadow: 0 8px 24px rgba(29, 30, 34, 0.18); animation: toast-in 0.4s var(--spring) both; pointer-events: auto; }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.toast--ok svg { color: #7fd3a7; }
.toast--err svg { color: #f2a396; }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity 0.25s, transform 0.25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 48px 24px; color: var(--ink-2); }
.empty svg { width: 36px; height: 36px; color: var(--ink-3); }
.empty h3 { font-size: 1.125rem; color: var(--ink); }
.empty p { max-width: 38ch; font-size: 0.9375rem; }
