/* ============================================================
   Metropolitan College — Smart Kiosk Design System
   Portrait 27" Touch Kiosk
   ============================================================ */

:root {
  /* === Brand === */
  --mc-red: #F20000;
  --mc-red-700: #C40000;
  --mc-red-50: #FEF2F2;
  --mc-black: #1A1A1A;
  --mc-ink: #0F0F0F;

  /* === Neutrals === */
  --n-0: #FFFFFF;
  --n-50: #FAFAFA;
  --n-100: #F4F4F4;
  --n-200: #E8E8E8;
  --n-300: #D4D4D4;
  --n-400: #A3A3A3;
  --n-500: #737373;
  --n-600: #525252;
  --n-700: #404040;
  --n-800: #262626;
  --n-900: #171717;

  /* === Status === */
  --success: #0F8A3F;
  --success-bg: #E8F5EE;
  --warning: #B8580B;
  --warning-bg: #FFF4E5;
  --error: #C40000;
  --error-bg: #FEF2F2;
  --info: #1F5CB8;
  --info-bg: #EAF1FB;

  /* === Type === */
  --font-display: "PP Object Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  /* === Spacing (8pt grid scaled for 27" kiosk) === */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 40px;
  --s-8: 48px;
  --s-9: 64px;
  --s-10: 80px;
  --s-11: 96px;
  --s-12: 128px;

  /* === Radius === */
  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* === Shadow === */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.06), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.04);
  --shadow-xl: 0 24px 64px rgba(0,0,0,.14);

  /* === Type scale (kiosk-friendly large) === */
  --t-display: 96px;
  --t-h1: 64px;
  --t-h2: 48px;
  --t-h3: 36px;
  --t-h4: 28px;
  --t-body-lg: 24px;
  --t-body: 20px;
  --t-caption: 16px;
  --t-label: 14px;
}

/* ============================================================
   Reset + base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--mc-ink);
  background: #000;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; color: inherit; }
button:focus-visible { outline: 3px solid var(--mc-red); outline-offset: 4px; }
input { font-family: inherit; }

/* ============================================================
   Kiosk stage: portrait 27" → 1620 × 2880 px (16:9 inverted)
   Scales to viewport while preserving aspect.
   ============================================================ */
.kiosk-stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #0a0a0a;
  overflow: hidden;
}
.kiosk-frame {
  width: 1620px;
  height: 2880px;
  background: var(--n-0);
  position: relative;
  overflow: hidden;
  transform-origin: center;
}

/* ============================================================
   Shared screen scaffold
   ============================================================ */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--n-0);
}

.screen-header {
  background: var(--mc-red);
  color: var(--n-0);
  padding: 64px 80px 96px;
  border-bottom-left-radius: 80px;
  border-bottom-right-radius: 80px;
  position: relative;
  flex-shrink: 0;
}
.screen-header.compact {
  padding: 48px 80px 64px;
  border-bottom-left-radius: 56px;
  border-bottom-right-radius: 56px;
}
.screen-header.minimal {
  background: var(--n-0);
  color: var(--mc-ink);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  padding: 48px 80px 32px;
  border-bottom: 1px solid var(--n-200);
}
.screen-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.screen-header-logo {
  display: flex;
  align-items: center;
  gap: 24px;
}
.screen-header-logo img { height: 96px; display: block; }
.screen-header.minimal .screen-header-logo img { filter: none; }
.screen-header:not(.minimal) .screen-header-logo img { filter: brightness(0) invert(1); }

.screen-body {
  flex: 1;
  padding: 80px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.screen-body.no-pad { padding: 0; }

/* ============================================================
   Typography helpers
   ============================================================ */
.t-display { font-size: var(--t-display); line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; }
.t-h1 { font-size: var(--t-h1); line-height: 1.08; font-weight: 700; letter-spacing: -0.015em; }
.t-h2 { font-size: var(--t-h2); line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
.t-h3 { font-size: var(--t-h3); line-height: 1.2; font-weight: 600; }
.t-h4 { font-size: var(--t-h4); line-height: 1.3; font-weight: 600; }
.t-body-lg { font-size: var(--t-body-lg); line-height: 1.45; }
.t-body { font-size: var(--t-body); line-height: 1.5; }
.t-caption { font-size: var(--t-caption); line-height: 1.4; color: var(--n-600); }
.t-label { font-size: var(--t-label); line-height: 1.3; color: var(--n-600); letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600; }

.t-mono { font-family: var(--font-mono); }
.t-muted { color: var(--n-500); }
.t-strong { font-weight: 700; }

/* ============================================================
   Buttons (touch-first, 27" kiosk → 88px+ height)
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 44px;
  border-radius: var(--r-pill);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.02em;
  min-height: 104px;
  transition: transform 80ms ease, background 120ms ease;
  cursor: pointer;
  user-select: none;
  text-transform: uppercase;
}
.btn:active { transform: scale(0.985); }
.btn--full { width: 100%; }
.btn--primary {
  background: var(--mc-ink);
  color: var(--n-0);
}
.btn--primary:hover { background: var(--mc-black); }
.btn--secondary {
  background: var(--n-0);
  color: var(--mc-ink);
  border: 2px solid var(--mc-ink);
}
.btn--ghost {
  background: transparent;
  color: var(--mc-ink);
  border: 2px solid var(--n-300);
}
.btn--danger {
  background: var(--mc-red);
  color: var(--n-0);
}
.btn--icon-l { padding-left: 36px; }
.btn-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  margin-left: auto;
}
.btn--secondary .btn-arrow,
.btn--ghost .btn-arrow { background: transparent; }

.btn-row { display: flex; gap: 24px; }
.btn-row > .btn { flex: 1; }

/* === Smaller utility buttons === */
.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 28px;
  border-radius: var(--r-pill);
  font-size: 20px;
  font-weight: 600;
  border: 2px solid var(--n-300);
  background: var(--n-0);
  min-height: 64px;
}

/* === Lang toggle === */
.lang-toggle {
  display: inline-flex;
  background: rgba(255,255,255,.16);
  border-radius: var(--r-pill);
  padding: 6px;
  gap: 4px;
}
.lang-toggle button {
  padding: 14px 28px;
  border-radius: var(--r-pill);
  color: var(--n-0);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  min-width: 80px;
  opacity: 0.7;
}
.lang-toggle button.active {
  background: var(--n-0);
  color: var(--mc-red);
  opacity: 1;
}
.screen-header.minimal .lang-toggle { background: var(--n-100); }
.screen-header.minimal .lang-toggle button { color: var(--n-700); }
.screen-header.minimal .lang-toggle button.active { background: var(--mc-ink); color: var(--n-0); }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--n-0);
  border: 2px solid var(--n-200);
  border-radius: var(--r-lg);
  padding: 40px;
}
.card.elevated { box-shadow: var(--shadow-md); border-color: transparent; }
.card.selectable { cursor: pointer; transition: border-color 120ms, transform 80ms; }
.card.selectable:hover { border-color: var(--n-400); }
.card.selectable.selected { border-color: var(--mc-ink); border-width: 3px; padding: 39px; }
.card.selectable:active { transform: scale(0.995); }

/* === Option tile (large touch target) === */
.option-tile {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 36px 40px;
  background: var(--n-0);
  border: 2px solid var(--n-200);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color 120ms;
  min-height: 140px;
  width: 100%;
  text-align: left;
}
.option-tile:hover { border-color: var(--n-400); }
.option-tile.selected { border-color: var(--mc-ink); border-width: 3px; padding: 35px 39px; background: var(--n-50); }
.option-tile-icon {
  width: 88px;
  height: 88px;
  border-radius: 24px;
  background: var(--n-100);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.option-tile-text { flex: 1; min-width: 0; }
.option-tile-title { font-size: 28px; font-weight: 600; color: var(--mc-ink); margin: 0 0 6px; }
.option-tile-sub { font-size: 20px; color: var(--n-600); margin: 0; }
.option-tile-arrow {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--n-100);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.option-tile.selected .option-tile-arrow { background: var(--mc-ink); color: var(--n-0); }

/* ============================================================
   Step indicator
   ============================================================ */
.steps {
  display: flex;
  gap: 12px;
  align-items: center;
}
.steps-dot {
  height: 8px;
  flex: 1;
  background: rgba(255,255,255,.3);
  border-radius: 4px;
  transition: background 200ms;
}
.steps-dot.done { background: rgba(255,255,255,.7); }
.steps-dot.active { background: var(--n-0); }

.screen-header.minimal .steps-dot { background: var(--n-200); }
.screen-header.minimal .steps-dot.done { background: var(--n-500); }
.screen-header.minimal .steps-dot.active { background: var(--mc-ink); }

/* ============================================================
   Keypad
   ============================================================ */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 720px;
}
.keypad button {
  height: 144px;
  background: var(--n-100);
  border-radius: var(--r-lg);
  font-size: 48px;
  font-weight: 600;
  color: var(--mc-ink);
  transition: background 100ms;
}
.keypad button:hover { background: var(--n-200); }
.keypad button:active { background: var(--n-300); }
.keypad button.action { background: var(--mc-ink); color: var(--n-0); }
.keypad button.action:hover { background: var(--mc-black); }
.keypad button.danger { background: var(--mc-red-50); color: var(--error); }

/* ============================================================
   Code/RF input display
   ============================================================ */
.code-display {
  background: var(--n-50);
  border: 3px solid var(--n-200);
  border-radius: var(--r-lg);
  padding: 40px 48px;
  font-family: var(--font-mono);
  font-size: 56px;
  font-weight: 600;
  color: var(--mc-ink);
  letter-spacing: 0.06em;
  text-align: center;
  min-height: 156px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.code-display.has-error { border-color: var(--error); background: var(--error-bg); }
.code-caret { display: inline-block; width: 4px; height: 1em; background: var(--mc-ink); margin-left: 8px; animation: blink 1s infinite; vertical-align: middle; }
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

/* ============================================================
   Status panels (success / error / warning)
   ============================================================ */
.status-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 80px 40px;
}
.status-icon {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 48px;
}
.status-icon.success { background: var(--success-bg); color: var(--success); }
.status-icon.error { background: var(--error-bg); color: var(--error); }
.status-icon.warning { background: var(--warning-bg); color: var(--warning); }
.status-icon.info { background: var(--info-bg); color: var(--info); }

/* ============================================================
   Bottom action bar (sticky on long screens)
   ============================================================ */
.action-bar {
  display: flex;
  gap: 24px;
  padding: 40px 80px;
  background: var(--n-0);
  border-top: 1px solid var(--n-200);
  flex-shrink: 0;
}

/* ============================================================
   Modal / overlay
   ============================================================ */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: grid;
  place-items: center;
  z-index: 100;
}
.modal {
  background: var(--n-0);
  border-radius: var(--r-xl);
  padding: 80px;
  width: 1100px;
  max-width: calc(100% - 160px);
  box-shadow: var(--shadow-xl);
  text-align: center;
}

/* ============================================================
   QR placeholder / hardware visuals
   ============================================================ */
.qr-frame {
  width: 480px;
  height: 480px;
  background: var(--n-0);
  border: 4px solid var(--mc-ink);
  border-radius: var(--r-lg);
  padding: 24px;
  display: grid;
  place-items: center;
}
.qr-svg { width: 100%; height: 100%; }

.hardware-illustration {
  border: 2px dashed var(--n-300);
  border-radius: var(--r-lg);
  padding: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  background: var(--n-50);
}

/* ============================================================
   Receipt
   ============================================================ */
.receipt {
  background: #fafaf7;
  border-radius: var(--r-md);
  padding: 56px;
  font-family: var(--font-mono);
  font-size: 22px;
  line-height: 1.6;
  box-shadow: var(--shadow-md);
  position: relative;
}
.receipt::before, .receipt::after {
  content: '';
  display: block;
  height: 24px;
  margin: -56px -56px 32px;
  background: radial-gradient(circle at 12px 0, transparent 12px, #fafaf7 12px);
  background-size: 24px 24px;
  background-repeat: repeat-x;
}
.receipt::after {
  margin: 32px -56px -56px;
  background: radial-gradient(circle at 12px 24px, transparent 12px, #fafaf7 12px);
  background-size: 24px 24px;
  background-repeat: repeat-x;
}
.receipt-row { display: flex; justify-content: space-between; gap: 24px; }
.receipt-divider { border-top: 2px dashed var(--n-300); margin: 24px 0; }

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 240ms ease-out; }

@keyframes spinner { to { transform: rotate(360deg); } }
.spinner {
  width: 80px;
  height: 80px;
  border: 8px solid var(--n-200);
  border-top-color: var(--mc-ink);
  border-radius: 50%;
  animation: spinner 0.9s linear infinite;
}

@keyframes pulse-dot {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}
.pulse-dots { display: inline-flex; gap: 6px; }
.pulse-dots span {
  width: 12px; height: 12px; border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 1.2s infinite;
}
.pulse-dots span:nth-child(2) { animation-delay: 0.15s; }
.pulse-dots span:nth-child(3) { animation-delay: 0.3s; }

/* ============================================================
   Inactivity-warning corner badge
   ============================================================ */
.inactivity-badge {
  position: absolute;
  bottom: 32px;
  left: 80px;
  background: var(--n-100);
  border-radius: var(--r-pill);
  padding: 14px 22px;
  font-size: 16px;
  color: var(--n-600);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 5;
}

/* ============================================================
   Demo helpers (debug screen jumper)
   ============================================================ */
.dev-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  background: var(--mc-ink);
  color: var(--n-0);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  font-size: 22px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  border: none;
}
.dev-panel {
  position: fixed;
  bottom: 88px;
  right: 20px;
  width: 320px;
  max-height: 70vh;
  overflow: auto;
  background: var(--n-0);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  padding: 16px;
  z-index: 9999;
  font-size: 13px;
}
.dev-panel h4 { margin: 8px 0 4px; font-size: 11px; color: var(--n-500); text-transform: uppercase; letter-spacing: 0.06em; }
.dev-panel button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  margin: 2px 0;
  border-radius: 8px;
  font-size: 13px;
  background: var(--n-100);
  color: var(--n-800);
}
.dev-panel button:hover { background: var(--n-200); }
.dev-panel button.active { background: var(--mc-ink); color: var(--n-0); }
