/**
 * [INPUT]: none (standalone CSS custom property and reset foundation)
 * [OUTPUT]: provides Bécane Paris gallery color palette, typography, spacing, radii, motion tokens, and accessible base reset
 * [POS]: foundational stylesheet of web/styles/, imported first by web/index.html and web/signin.html
 * [PROTOCOL]: Update this header on change, then check GEMINI.md
 */

/* ==========================================================================
   Design Tokens — Bécane Paris Architectural Fashion Studio
   ========================================================================== */
:root {
  --bg-canvas: #F6F6F6;
  --bg-bar: #FFFFFF;
  --bg-well: #EFEFEF;
  --bg-hover: #F0F0F0;

  --ink: #0A0A0A;
  --muted: #666666;
  --index-ink: #999999;
  --hairline: #E6E6E6;
  --hairline-strong: #D4D4D4;
  --overlay: hsla(0, 0%, 96%, 0.84);

  --ok: #14532D;
  --ok-bg: #ECFDF3;
  --warn: #7C2D12;
  --warn-bg: #FFF7ED;
  --err: #881337;
  --err-bg: #FFF1F2;

  --font-sans: "Inter", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Menlo", "Consolas", ui-monospace, monospace;

  --radius-bar: 3px;
  --radius-panel: 4px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --dur-fast: 150ms;
  --dur-base: 220ms;

  --hud-edge: 16px;
  --hud-height: 36px;
  --hud-gap: 6px;

  --z-base: 1;
  --z-hud: 40;
  --z-action-bar: 45;
  --z-popover: 60;
  --z-drawer: 80;
  --z-toast: 100;
}

/* ==========================================================================
   Base Reset & Accessibility
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg-canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
}

body.atelier-body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg-canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}

button:active:not(:disabled) {
  transform: scale(0.97);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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

[hidden] {
  display: none !important;
}

/* ==========================================================================
   Shared Typography & Primitive Controls
   ========================================================================== */
.mono-idx {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--index-ink);
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
  white-space: nowrap;
}

.mono-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-bar);
  background: var(--ink);
  color: var(--bg-bar);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-bar);
  background: var(--bg-bar);
  color: var(--ink);
  border: 1px solid var(--hairline);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-bar);
  background: var(--err-bg);
  color: var(--err);
  border: 1px solid #FECDD3;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-bar);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover:not(:disabled) {
    opacity: 0.88;
  }
  .btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--hairline-strong);
  }
  .btn-ghost:hover:not(:disabled) {
    color: var(--ink);
    background: var(--bg-hover);
  }
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.field-input,
.field-select,
.field-textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: var(--radius-bar);
  border: 1px solid var(--hairline);
  background: var(--bg-bar);
  color: var(--ink);
  font-size: 13px;
  transition: border-color var(--dur-fast) var(--ease-out);
}

.field-textarea {
  min-height: 76px;
  resize: vertical;
  line-height: 1.5;
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--ink);
  outline: none;
}

.field-hint {
  font-size: 12px;
  color: var(--muted);
}

.mono-input {
  font-family: var(--font-mono);
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-bar);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}

.status-pill.is-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.status-pill.is-warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.status-pill.is-err {
  background: var(--err-bg);
  color: var(--err);
}

.status-pill.is-neutral {
  background: var(--bg-well);
  color: var(--muted);
}

.boot-stage {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.boot-mark {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.22em;
  font-weight: 600;
}

.boot-label {
  font-size: 12px;
  color: var(--muted);
}

@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;
  }
}
