/* Vuzio design system — tokens and components (design-system/vuzio/MASTER.md).
   One file for vuzio.app, the mail-connect form and the calendar page. */

:root {
  --blue: #174cf4;
  --electric: #087bff;
  --sky: #38bdf8;
  --cyan: #38e0f2;
  --deep: #0837d9;
  --ice: #edf5ff;
  --success: #16a344;
  --warning: #d97706;
  --error: #dc3545;
  --info: #174cf4;
  --blue-text: var(--blue);
  --success-text: var(--success);
  --warning-text: var(--warning);
  --error-text: var(--error);
  --purple-text: var(--purple);
  --purple: #7c3aed;
  --bg: #f8fafd;
  --surface: #ffffff;
  --text: #111827;
  --text-2: #667085;
  --text-3: #98a2b3; /* decorative only (placeholders, disabled): 2.4:1, never for text people read */
  --border: #ebedf4;
  --gradient: linear-gradient(135deg, #38d9f3 0%, #1687ff 48%, #0837d9 100%);
  --ring: 0 0 0 4px rgba(23, 76, 244, 0.14);
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.04), 0 1px 3px rgba(17, 24, 39, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(17, 24, 39, 0.12), 0 2px 6px rgba(17, 24, 39, 0.04);
  --shadow-blue: 0 10px 24px -10px rgba(23, 76, 244, 0.55);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font-head: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* motion: arrivals settle, nothing bounces (MASTER §motion) */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease: var(--ease-out);
  --dur-press: 120ms;
  --dur-fast: 160ms;
  --dur-base: 220ms;
  --dur-slow: 320ms;
  --dur-enter: 560ms;
  --stagger: 70ms;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ice: #13213f;
    --bg: #0b1120;
    --surface: #111a2e;
    --text: #f2f5fb;
    --text-2: #a3adc2;
    --text-3: #6b778f;
    --border: #1f2a40;
    --ring: 0 0 0 4px rgba(56, 189, 248, 0.22);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
    /* Text-on-tint colors lifted for dark backgrounds (contrast ≥ 4.5:1); fills keep the
       brand values. */
    --blue-text: #7aa2ff;
    --success-text: #4ade80;
    --warning-text: #fbbf24;
    --error-text: #ff7a85;
    --purple-text: #b794f6;
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/22px var(--font-body);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

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

a {
  color: var(--blue-text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--blue-text);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---- typography (MASTER §03) ---- */
.display,
.h1,
.h2,
.h3,
.title {
  font-family: var(--font-head);
  margin: 0;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.display { font-size: 32px; line-height: 40px; font-weight: 700; letter-spacing: -0.02em; }
.h1 { font-size: 28px; line-height: 36px; font-weight: 700; }
.h2 { font-size: 24px; line-height: 32px; font-weight: 650; }
.h3 { font-size: 20px; line-height: 28px; font-weight: 650; }
.title { font-size: 17px; line-height: 24px; font-weight: 600; }
.body { font-size: 15px; line-height: 22px; }
.secondary { font-size: 13px; line-height: 20px; color: var(--text-2); }
.caption { font-size: 12px; line-height: 18px; font-weight: 500; color: var(--text-2); }
.muted { color: var(--text-2); }

/* ---- icons (Lucide, 24 px, stroke 2) ---- */
.icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm { width: 18px; height: 18px; }
.icon-xs { width: 16px; height: 16px; }

/* ---- buttons (MASTER §05) ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: 600 15px/1 var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--dur-press) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--blue); color: #fff; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--deep); }
}
.btn-secondary { background: var(--ice); color: var(--blue-text); }
.btn-secondary:hover { background: color-mix(in srgb, var(--ice) 80%, var(--blue)); }
.btn-tertiary { background: none; color: var(--blue-text); padding: 0 4px; min-height: 44px; }
.btn-tertiary .icon,
.link-arrow .icon { transition: transform var(--dur-base) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .btn-tertiary:hover .icon,
  .link-arrow:hover .icon { transform: translateX(3px); }
}
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--text-3); }
.btn-danger { background: color-mix(in srgb, var(--error) 10%, var(--surface)); color: var(--error-text); }
.btn[disabled],
.btn-disabled {
  background: var(--border);
  color: var(--text-3);
  box-shadow: none;
  cursor: not-allowed;
}
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 16px; border-radius: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: 48px; padding: 0; }

/* ---- inputs (MASTER §06) ---- */
.field { display: grid; gap: 8px; }
.label { font: 600 13px/20px var(--font-body); color: var(--text); }
.input {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-3);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.input input {
  flex: 1;
  min-width: 0;
  height: 50px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 400 16px/1 var(--font-body);
}
.input input::placeholder { color: var(--text-3); }
.input:focus-within { border-color: var(--blue); box-shadow: var(--ring); color: var(--blue-text); }
.input.is-error { border-color: var(--error); color: var(--error); }
.input.is-error:focus-within { box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.14); }
.input.is-success { border-color: var(--success); color: var(--success); }
.field-error { animation: vz-drop var(--dur-base) var(--ease-out) both; }
.field-error { display: flex; gap: 6px; align-items: flex-start; color: var(--error-text); font-size: 13px; line-height: 20px; }
.field-hint { color: var(--text-2); font-size: 13px; line-height: 20px; }

/* ---- badges & status (MASTER §07) ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  font: 600 12px/1 var(--font-body);
  white-space: nowrap;
}
.badge-blue { background: var(--ice); color: var(--blue-text); }
.badge-green { background: color-mix(in srgb, var(--success) 12%, var(--surface)); color: var(--success-text); }
.badge-orange { background: color-mix(in srgb, var(--warning) 13%, var(--surface)); color: var(--warning-text); }
.badge-red { background: color-mix(in srgb, var(--error) 11%, var(--surface)); color: var(--error-text); }
.badge-purple { background: color-mix(in srgb, var(--purple) 11%, var(--surface)); color: var(--purple-text); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-now { background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 18%, transparent); }
.dot-next { background: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 16%, transparent); }
.dot-done { background: var(--text-3); }

/* ---- cards (MASTER §09) ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.class-card {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 14px 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.class-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--blue);
}
.class-card.is-now::before { background: var(--success); }
.class-card.is-done::before { background: var(--text-3); }
.class-card.is-cancelled::before { background: var(--error); }
.class-card.is-cancelled .class-title,
.class-card.is-cancelled .class-time strong { color: var(--text-3); }
.class-time { display: grid; align-content: start; font-variant-numeric: tabular-nums; }
.class-time strong { font: 700 15px/22px var(--font-head); }
.class-time span { font-size: 13px; line-height: 20px; color: var(--text-2); }
.class-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: flex-start; justify-content: space-between; }
.class-title,
.class-meta,
.class-room { min-width: 0; overflow-wrap: anywhere; }
.class-title { font: 600 15px/22px var(--font-head); margin: 0; }
.class-meta { font-size: 13px; line-height: 20px; color: var(--text-2); margin: 2px 0 0; }
.class-room { display: flex; align-items: flex-start; gap: 4px; font-size: 13px; line-height: 20px; color: var(--text-2); margin-top: 2px; }

.class-room .icon { margin-top: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---- page shells ---- */
.container { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(460px, 100% - 32px); margin-inline: auto; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo-word { font: 800 22px/1 var(--font-head); letter-spacing: -0.03em; }
.tile {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--ice);
  color: var(--blue-text);
}
.surface-gradient { background: var(--gradient); color: #fff; }

/* ---- shared keyframes: only `from` is set, the resting state is the element's own ---- */
@keyframes vz-rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes vz-msg { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
@keyframes vz-pop { from { opacity: 0; transform: scale(0.92); } }
@keyframes vz-drop { from { opacity: 0; transform: translateY(-4px); } }
@keyframes vz-fade { from { opacity: 0; } }

/* ---- disclosure (<details>): CSS only, safe under the connect page's CSP ---- */
details > summary { list-style: none; cursor: pointer; touch-action: manipulation; }
details > summary::-webkit-details-marker { display: none; }
details > summary .chev { transition: transform var(--dur-base) var(--ease-in-out); }
details[open] > summary .chev { transform: rotate(180deg); }
details[open] > .details-body { animation: vz-drop var(--dur-slow) var(--ease-out); }

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