/* Screens: sign-in, the till and its receipt slip, the owner's dashboard. */

/* ---- sign-in and password change ---------------------------------------------------------------------------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-story {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-6);
  padding: clamp(28px, 5vw, 64px); color: #f3f7f4;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(61, 191, 130, 0.35), transparent 60%),
    radial-gradient(90% 70% at 100% 100%, rgba(255, 255, 255, 0.08), transparent 60%),
    var(--brand-deep);
}
.auth-story::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.18; mix-blend-mode: overlay;
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.5) 0 1px, transparent 1px 3px);
}
.auth-brand { display: flex; align-items: center; gap: var(--space-3); font-weight: 700; font-size: var(--text-lg); position: relative; z-index: 1; }
.auth-brand .brand-mark { background: #fff; color: var(--brand-deep); }
.auth-story h1 { font-size: var(--text-hero); line-height: 1.02; letter-spacing: -0.03em; max-width: 12ch; position: relative; z-index: 1; }
.auth-story h1 em { font-style: normal; color: var(--brand-glow); }
.auth-steps { display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; counter-reset: step; position: relative; z-index: 1; max-width: 420px; }
.auth-steps li { display: grid; grid-template-columns: 32px 1fr; gap: var(--space-3); align-items: start; counter-increment: step; color: rgba(243, 247, 244, 0.85); }
.auth-steps li::before { content: counter(step); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.35); font-weight: 700; font-size: var(--text-sm); }
.auth-steps strong { display: block; color: #fff; }
.auth-form-side { display: grid; place-items: center; padding: clamp(24px, 5vw, 64px) var(--gutter); }
.auth-card { width: min(400px, 100%); }
.auth-card h2 { font-size: var(--text-xl); margin-bottom: var(--space-2); }
.auth-card > p { color: var(--ink-2); margin-bottom: var(--space-5); }
.auth-card form { display: grid; }
.auth-card .primary-button { margin-top: var(--space-5); width: 100%; }
.password-form .primary-button { margin-top: var(--space-5); }
.auth-footer { margin-top: var(--space-5); font-size: var(--text-xs); color: var(--ink-3); }
.auth-footer a { color: inherit; }
.password-rules { margin: var(--space-2) 0 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: var(--text-xs); color: var(--ink-3); }
.password-rules li::before { content: "○ "; }
.password-rules li.met { color: var(--brand-strong); }
.password-rules li.met::before { content: "● "; }
@media (max-width: 899px) {
  .auth { grid-template-columns: 1fr; }
  .auth-story { padding-bottom: var(--space-6); }
  .auth-steps { display: none; }
  .auth-story h1 { font-size: 2rem; }
}

/* ---- till ----------------------------------------------------------------------------------------------- */
.till { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr); gap: var(--space-5); align-items: start; }
@media (max-width: 1099px) { .till { grid-template-columns: 1fr; } }

.scan-zone {
  position: relative; display: grid; gap: var(--space-4); padding: var(--space-5);
  border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2);
}
.scan-zone h2 { font-size: var(--text-xl); }
.scan-zone .scan-intro { color: var(--ink-2); max-width: 52ch; }
.scan-row { display: flex; gap: var(--space-2); }
.scan-row .input { min-height: 56px; font-size: var(--text-lg); letter-spacing: 0.01em; }
.scan-row .primary-button { min-height: 56px; }
.scan-or { display: flex; align-items: center; gap: var(--space-3); color: var(--ink-3); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.scan-or::before, .scan-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.paused-banner { display: flex; gap: var(--space-3); align-items: center; }
.result-area { margin-top: var(--space-4); }
.result-area:empty { display: none; }

.camera {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: #050807;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.camera video { width: 100%; height: 100%; object-fit: cover; }
.camera-frame { position: absolute; inset: 14% 22%; pointer-events: none; container-type: size; }
.camera-frame::before, .camera-frame::after, .camera-frame span::before, .camera-frame span::after {
  content: ""; position: absolute; width: 34px; height: 34px; border: 4px solid var(--brand-glow); border-radius: 6px;
}
.camera-frame::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.camera-frame::after { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.camera-frame span::before { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.camera-frame span::after { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.camera-frame i {
  position: absolute; left: 6%; right: 6%; top: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--brand-glow), transparent);
  box-shadow: 0 0 16px var(--brand-glow); animation: scan-line 2.2s var(--ease-out) infinite alternate;
}
@keyframes scan-line { from { transform: translateY(0); } to { transform: translateY(calc(100cqh - 2px)); } }
.camera-bar { position: absolute; left: var(--space-3); right: var(--space-3); bottom: var(--space-3); display: flex; gap: var(--space-2); justify-content: space-between; }
.camera-bar .ghost-button { background: rgba(10, 14, 12, 0.6); color: #fff; border-color: rgba(255, 255, 255, 0.2); backdrop-filter: blur(6px); }
.camera-hint { position: absolute; top: var(--space-3); left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, 0.86); font-size: var(--text-sm); font-weight: 600; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }

/* The scan result is a receipt slip: what this student can use here, then exactly what to key into the till. */
.slip {
  position: relative; padding: var(--space-5) var(--space-5) var(--space-6); background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-2);
  --tooth: 10px;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--tooth) * 2) var(--tooth) repeat-x, linear-gradient(#000 0 0) top / 100% calc(100% - var(--tooth)) no-repeat;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--tooth) * 2) var(--tooth) repeat-x, linear-gradient(#000 0 0) top / 100% calc(100% - var(--tooth)) no-repeat;
  animation: slip-in var(--duration) var(--ease-out);
}
@keyframes slip-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.slip-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding-bottom: var(--space-4); border-bottom: 2px dashed var(--line-strong); }
.slip-head .student { font-size: var(--text-xl); font-weight: 700; }
.slip-timer { margin-left: auto; font-size: var(--text-sm); font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.slip-timer.ending { color: var(--warn); }
.slip-section { padding: var(--space-4) 0 var(--space-2); }
.slip-section + .slip-section { border-top: 1px dashed var(--line); }
.slip-section h3 { font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--space-3); }
.slip-line { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; }
.slip-line .what { display: grid; gap: 2px; min-width: 0; }
.slip-line .what strong { font-size: var(--text-base); }
.slip-line .what span { font-size: var(--text-xs); color: var(--ink-2); }
.stamp-dots { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 var(--space-2); }
.stamp-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); }
.stamp-dots i.on { background: var(--brand); border-color: var(--brand); }
.stepper { display: inline-grid; grid-template-columns: 44px 44px 44px; align-items: center; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: var(--surface); }
.stepper button { height: 44px; border: 0; background: none; font-size: 1.25rem; font-weight: 600; cursor: pointer; color: var(--ink); }
.stepper button:hover:not(:disabled) { background: var(--surface-sunk); }
.stepper button:disabled { color: var(--ink-3); cursor: not-allowed; }
.stepper output { text-align: center; font-weight: 700; font-size: var(--text-lg); font-variant-numeric: tabular-nums; }
.stepper.has-value { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.reward-toggle { min-height: 44px; padding: 0 var(--space-4); border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface); font-weight: 700; cursor: pointer; }
.reward-toggle[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.slip-foot { display: grid; gap: var(--space-3); padding-top: var(--space-4); border-top: 2px dashed var(--line-strong); margin-top: var(--space-2); }
.slip-foot .slip-buttons { display: flex; gap: var(--space-2); }
.slip-foot .slip-buttons .primary-button { flex: 1; }
.slip-total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; }
.slip-total .figure { font-size: var(--text-xl); }

.slip.done { background: var(--surface); }
.slip.done .done-title { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-xl); font-weight: 700; color: var(--brand-strong); }
.done-check { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: var(--on-brand); }
.key-in { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; gap: var(--space-2); }
.key-in li { display: grid; grid-template-columns: 1fr auto; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: 12px; background: var(--surface-sunk); border: 1px solid var(--line); font-weight: 600; }
.key-in li .figure { font-size: var(--text-lg); }
.key-in li.minus .figure { color: var(--danger); }
.key-in li.free .figure { color: var(--brand-strong); }

.slip.refused { border-radius: var(--radius-lg); -webkit-mask: none; mask: none; background: var(--danger-tint); color: var(--danger); box-shadow: none; padding-bottom: var(--space-5); }
.slip.refused strong { display: block; font-size: var(--text-lg); margin-bottom: var(--space-1); }

.day-list { display: grid; gap: var(--space-2); }
.day-row { display: grid; grid-template-columns: 52px 1fr auto; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.day-row time { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: var(--text-sm); }
.day-row .what { min-width: 0; }
.day-row .what strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-row .what span { font-size: var(--text-xs); color: var(--ink-2); }
.day-row.voided { opacity: 0.55; }
.day-row.voided strong { text-decoration: line-through; }
.day-row .side { display: grid; justify-items: end; gap: 4px; }

/* ---- dashboard -------------------------------------------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--space-3); margin-bottom: var(--space-5); }
.kpi { padding: var(--space-4) var(--space-5); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); display: grid; gap: 4px; align-content: start; }
.kpi .label { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.kpi .figure { font-size: var(--text-figure); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.kpi .sub { font-size: var(--text-sm); color: var(--ink-2); }
.kpi.lead { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; box-shadow: var(--shadow-2); }
.kpi.lead .label, .kpi.lead .sub { color: rgba(255, 255, 255, 0.75); }
@media (max-width: 899px) { .kpis { grid-template-columns: 1fr 1fr; } .kpi.lead { grid-column: 1 / -1; } }

.chart-card { padding: var(--space-5); }
.chart-legend { display: flex; flex-wrap: wrap; gap: var(--space-4); font-size: var(--text-xs); color: var(--ink-2); font-weight: 600; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; }
.chart { width: 100%; height: 220px; margin-top: var(--space-3); overflow: visible; }
.chart .bar-discount { fill: var(--brand); }
.chart .bar-reward { fill: var(--warn); }
.chart .gridline { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .axis { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.chart rect:hover { opacity: 0.8; }
.swatch-discount { background: var(--brand); }
.swatch-reward { background: var(--warn); }
.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--space-4); }
@media (max-width: 1099px) { .two-col { grid-template-columns: 1fr; } }

/* ---- team and terms ---------------------------------------------------------------------------------------- */
.person { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-3); align-items: center; }
.person .who strong { display: block; }
.person .who span { font-size: var(--text-xs); color: var(--ink-2); }
.prose { max-width: 72ch; }
.prose h2 { font-size: var(--text-lg); margin: 0 0 var(--space-2); }
.prose .section-title { display: block; margin: var(--space-5) 0 var(--space-2); }
.prose p, .prose li { color: var(--ink-2); }
.prose p + p { margin-top: var(--space-3); }
.prose ul { padding-left: 1.2em; display: grid; gap: var(--space-1); }
.draft-note { margin-bottom: var(--space-5); }
