/* ── Tokens (matching horloge.thenolimits.group) ── */
:root {
  --background: oklch(10.07% 0.012 248.5);
  --foreground: oklch(96.32% 0.006 248.1);
  --surface: oklch(14.5% 0.01 230);
  --surface-secondary: oklch(20% 0.008 230);
  --accent: oklch(88.5% 0.165 93);
  --accent-foreground: oklch(10% 0.03 93);
  --danger: oklch(64.12% 0.238 26.23);
  --success: oklch(60.28% 0.163 144.56);
  --muted: oklch(48.14% 0.007 248.7);
  --border: oklch(28% 0.008 230);
}

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

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--foreground);
  font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Dot pattern backdrop ── */
.po-backdrop {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 20px 20px;
  mask-image: radial-gradient(ellipse 50% 45% at 50% 50%, transparent 20%, black 70%);
  -webkit-mask-image: radial-gradient(ellipse 50% 45% at 50% 50%, transparent 20%, black 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ── */
.po-page {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 16px 64px;
}

.po-page-center {
  justify-content: center;
}

/* ── Wordmark + lang toggle ── */
.po-header-row {
  width: 100%;
  max-width: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 32px;
}

.po-wordmark {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.po-wordmark-sub {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: 2px;
}

.po-lang-toggle {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 4px;
}

.po-lang-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.po-lang-btn:hover { color: var(--foreground); border-color: var(--foreground); }
.po-lang-active { background: rgba(248,214,47,0.12); border-color: var(--accent); color: var(--accent); }

/* ── Card ── */
.po-card {
  width: 100%;
  max-width: 520px;
}

/* ── Title ── */
.po-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--foreground);
  text-align: center;
  margin: 0 0 4px 0;
}

.po-subtitle {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin: 0 0 28px 0;
}

/* ── Alert card (welcome screen) ── */
.po-alert-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}

.po-alert-content {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  white-space: pre-line;
}

/* ── Fields ── */
.po-field { margin-bottom: 16px; }

.po-optional {
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

.po-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 6px;
}

.po-label-req::after { content: ' *'; color: var(--danger); }

.po-input,
.po-select,
.po-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--foreground);
  font-size: 14px;
  font-family: inherit;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.po-input:focus,
.po-select:focus,
.po-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.po-input::placeholder,
.po-textarea::placeholder { color: var(--muted); }

.po-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.po-select option { background: var(--surface); color: var(--foreground); }

.po-textarea { min-height: 120px; resize: vertical; }

.po-error { border-color: var(--danger) !important; box-shadow: 0 0 0 1px var(--danger) !important; }

.po-error-msg {
  font-size: 12px;
  color: var(--danger);
  margin-top: 6px;
  display: none;
}

.po-general-error { text-align: center; margin-top: 12px; }

.po-char-count {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.po-char-count-ok { color: var(--success); }

/* ── Identity Toggle ── */
.po-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.po-toggle-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.po-toggle-btn:first-child { border-right: 1px solid var(--border); }
.po-toggle-btn:hover { color: var(--foreground); }
.po-toggle-active { background: rgba(248,214,47,0.1); color: var(--accent); }

/* ── Identity Slide ── */
.po-identity-fields {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
  margin-top: 0;
}

.po-identity-on {
  max-height: 280px;
  opacity: 1;
  margin-top: 16px;
}

/* ── Restaurant Context Card ── */
.po-resto-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
}

.po-resto-name { color: var(--foreground); font-weight: 500; font-size: 13px; }
.po-resto-addr { color: var(--muted); margin-top: 2px; font-size: 12px; }

/* ── Dropzone ── */
.po-dropzone {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.po-dropzone:hover,
.po-dropzone-over {
  border-color: var(--accent);
  background: rgba(248,214,47,0.03);
}

.po-dropzone p { margin: 0; }

/* ── File Chips ── */
.po-file-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.po-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--foreground);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
}

.po-file-chip-x {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  transition: color 0.15s;
}

.po-file-chip-x:hover { color: var(--danger); }

/* ── Submit Button ── */
.po-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: var(--accent-foreground);
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.po-btn:hover { opacity: 0.9; }
.po-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Spinner ── */
.po-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: var(--accent-foreground);
  border-radius: 50%;
  animation: po-spin 0.6s linear infinite;
}

@keyframes po-spin { to { transform: rotate(360deg); } }

/* ── Confirmation ── */
.po-confirm { text-align: center; padding: 40px 0; }

.po-confirm-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(34,197,94,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.po-confirm-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--foreground);
  margin: 0 0 12px 0;
}

.po-confirm-ref {
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--accent);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 20px 0;
}

.po-confirm-msg {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 8px 0;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.po-confirm-email {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 28px 0;
}

.po-confirm-another {
  display: inline-block;
  padding: 10px 24px;
  background: var(--accent);
  color: var(--accent-foreground);
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity 0.15s;
}

.po-confirm-another:hover { opacity: 0.9; }

/* ── Calendar picker ── */
.po-date-btn {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.po-date-btn-filled { color: var(--foreground); font-weight: 500; text-transform: capitalize; }
.po-date-btn:hover { border-color: var(--accent); }

.po-cal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.6);
  align-items: flex-end;
  justify-content: center;
}

.po-cal-overlay-on { display: flex; }

.po-cal-sheet {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: po-cal-slide-up 0.25s ease-out;
}

@keyframes po-cal-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.po-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.po-cal-header-title { font-size: 14px; font-weight: 600; color: var(--foreground); }

.po-cal-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.po-cal-close:hover { color: var(--foreground); }

.po-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 8px;
}

.po-cal-nav-label { font-size: 14px; font-weight: 600; color: var(--foreground); text-transform: capitalize; }

.po-cal-nav-btns { display: flex; gap: 6px; }

.po-cal-nav-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.po-cal-nav-btn:hover { border-color: var(--accent); color: var(--accent); }

.po-cal-grid {
  padding: 0 16px 20px;
}

.po-cal-grid table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.po-cal-grid thead th {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  padding: 8px 0;
  text-align: center;
}

.po-cal-day {
  text-align: center;
  padding: 0;
  vertical-align: middle;
}

.po-cal-day-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--foreground);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.12s;
  margin: 2px auto;
  display: block;
}

.po-cal-day-btn:hover { background: rgba(255,255,255,0.06); }
.po-cal-day-other { color: var(--muted); opacity: 0.3; }
.po-cal-day-today { font-weight: 700; position: relative; }

.po-cal-day-today::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.po-cal-day-sel {
  background: var(--accent) !important;
  color: var(--accent-foreground) !important;
  font-weight: 700;
}

.po-cal-day-sel::after { display: none; }

.po-cal-day-future {
  color: var(--muted);
  opacity: 0.2;
  cursor: default;
}

.po-cal-day-future:hover { background: transparent; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .po-page { padding: 24px 16px; }
  .po-header-row { margin-bottom: 24px; }
  .po-toggle-btn { font-size: 12px; padding: 9px 8px; }
}
