/* ============================================================
   OrangeBlock Event App — Core Styles
   Design tokens from OrangeBlock Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700;800;900&family=Inter:wght@400;500;600;700&display=swap');

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Brand */
  --ob-brand:         #E8610A;
  --ob-brand-bright:  #FF7A2B;
  --ob-brand-muted:   #C44D06;
  --ob-brand-subtle:  rgba(232,97,10,0.12);
  --ob-brand-border:  rgba(232,97,10,0.30);

  /* Backgrounds */
  --ob-bg-base:       #09090F;
  --ob-bg-raised:     #111120;
  --ob-bg-overlay:    #18182A;
  --ob-bg-elevated:   #1F1F35;

  /* Surfaces */
  --ob-surface-1:     #141428;
  --ob-surface-2:     #1C1C32;
  --ob-surface-3:     #24243E;
  --ob-surface-4:     #2C2C4A;

  /* Text */
  --ob-text-primary:   #FFFFFF;
  --ob-text-secondary: #A8A8C8;
  --ob-text-muted:     #64648A;
  --ob-text-disabled:  #38385A;
  --ob-text-brand:     #E8610A;

  /* Accents */
  --ob-electric: #6366F1;
  --ob-cyan:     #06B6D4;
  --ob-purple:   #A855F7;

  /* Semantic */
  --ob-success: #22C55E;
  --ob-warning: #F59E0B;
  --ob-error:   #EF4444;
  --ob-info:    #3B82F6;

  /* Event theming override — change this one variable to rebrand */
  --event-primary:   var(--ob-brand);
  --event-secondary: var(--ob-electric);

  /* Typography */
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body:    'Inter', sans-serif;

  /* Type scale */
  --text-xs:      11px;
  --text-sm:      13px;
  --text-base:    15px;
  --text-md:      17px;
  --text-lg:      20px;
  --text-xl:      24px;
  --text-2xl:     30px;
  --text-3xl:     38px;

  /* Spacing (4px grid) */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Radius */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.6);
  --shadow-brand: 0 0 24px rgba(232,97,10,0.35);

  /* Transitions */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast:    150ms;
  --dur-base:    250ms;
  --dur-slow:    400ms;

  /* Layout */
  --bottom-nav-height: 64px;
  --header-height:     56px;
  --safe-bottom:       env(safe-area-inset-bottom, 0px);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--ob-text-primary);
  background: var(--ob-bg-base);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font: inherit; }

/* ── App Shell ─────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ── Views (screens) ───────────────────────────────────────── */
.view {
  display: none;
  flex: 1;
  flex-direction: column;
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + var(--space-4));
}
.view.active { display: flex; }

/* ── Page Header ────────────────────────────────────────────── */
.page-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--ob-bg-base);
  border-bottom: 1px solid var(--ob-surface-2);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--header-height);
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  flex: 1;
}
.page-header .back-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: var(--ob-surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: background var(--dur-fast);
}
.page-header .back-btn:active { background: var(--ob-surface-3); }

/* ── Bottom Navigation ──────────────────────────────────────── */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  z-index: 100;
  height: calc(var(--bottom-nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--ob-surface-1);
  border-top: 1px solid var(--ob-surface-2);
  display: flex;
  align-items: stretch;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--space-2) 0;
  color: var(--ob-text-muted);
  font-size: var(--text-xs);
  font-weight: 500;
  transition: color var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
}
.nav-item .nav-icon {
  font-size: 22px;
  transition: transform var(--dur-fast) var(--ease-spring);
}
.nav-item.active {
  color: var(--event-primary);
}
.nav-item.active .nav-icon {
  transform: scale(1.15);
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--ob-surface-1);
  border: 1px solid var(--ob-surface-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-body { padding: var(--space-5); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  transition: all var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--event-primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(232,97,10,0.35);
}
.btn-primary:hover { background: var(--ob-brand-bright); }
.btn-secondary {
  background: var(--ob-surface-2);
  color: var(--ob-text-primary);
  border: 1px solid var(--ob-surface-3);
}
.btn-ghost {
  background: transparent;
  color: var(--ob-text-secondary);
}
.btn-full { width: 100%; }
.btn-lg { padding: var(--space-4) var(--space-6); font-size: var(--text-md); border-radius: var(--radius-lg); }

/* ── Form Inputs ────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ob-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--ob-surface-2);
  border: 1.5px solid var(--ob-surface-3);
  border-radius: var(--radius-md);
  color: var(--ob-text-primary);
  font-size: var(--text-base);
  transition: border-color var(--dur-fast);
  outline: none;
  -webkit-appearance: none;
}
.input:focus { border-color: var(--event-primary); }
.input::placeholder { color: var(--ob-text-muted); }
textarea.input { resize: vertical; min-height: 100px; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-brand   { background: var(--ob-brand-subtle); color: var(--ob-brand); border: 1px solid var(--ob-brand-border); }
.badge-success { background: rgba(34,197,94,0.12); color: var(--ob-success); }
.badge-muted   { background: var(--ob-surface-2); color: var(--ob-text-muted); }

/* ── Scroll container ───────────────────────────────────────── */
.scroll-y {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ── Avatar ─────────────────────────────────────────────────── */
.avatar {
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--ob-surface-3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ob-text-secondary);
  flex-shrink: 0;
}
.avatar-sm  { width: 32px;  height: 32px;  font-size: var(--text-sm); }
.avatar-md  { width: 44px;  height: 44px;  font-size: var(--text-base); }
.avatar-lg  { width: 64px;  height: 64px;  font-size: var(--text-xl); }
.avatar-xl  { width: 96px;  height: 96px;  font-size: var(--text-2xl); }

/* ── Divider ─────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--ob-surface-2);
  margin: var(--space-5) 0;
}

/* ── Loading spinner ────────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 2.5px solid var(--ob-surface-3);
  border-top-color: var(--event-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast notifications ─────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + var(--space-4));
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
  width: min(90vw, 360px);
}
.toast {
  background: var(--ob-surface-4);
  border: 1px solid var(--ob-surface-3);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: toast-in var(--dur-base) var(--ease-spring) both;
}
.toast.success { border-color: rgba(34,197,94,0.4); color: var(--ob-success); }
.toast.error   { border-color: rgba(239,68,68,0.4);  color: var(--ob-error); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Utility ─────────────────────────────────────────────────── */
.text-brand     { color: var(--event-primary); }
.text-muted     { color: var(--ob-text-muted); }
.text-secondary { color: var(--ob-text-secondary); }
.text-sm        { font-size: var(--text-sm); }
.text-xs        { font-size: var(--text-xs); }
.font-display   { font-family: var(--font-display); }
.font-bold      { font-weight: 700; }
.font-black     { font-weight: 900; }
.flex           { display: flex; }
.flex-col       { flex-direction: column; }
.items-center   { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2          { gap: var(--space-2); }
.gap-3          { gap: var(--space-3); }
.gap-4          { gap: var(--space-4); }
.p-4            { padding: var(--space-4); }
.p-5            { padding: var(--space-5); }
.px-5           { padding-left: var(--space-5); padding-right: var(--space-5); }
.py-4           { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.mb-4           { margin-bottom: var(--space-4); }
.mb-6           { margin-bottom: var(--space-6); }
.mt-2           { margin-top: var(--space-2); }
.mt-4           { margin-top: var(--space-4); }
.w-full         { width: 100%; }
.hidden         { display: none !important; }

/* ── Auth Screen ─────────────────────────────────────────────── */
#view-auth {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-6);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(232,97,10,0.18) 0%, transparent 70%),
    var(--ob-bg-base);
}
#view-auth .auth-logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
  color: var(--ob-text-primary);
  margin-bottom: var(--space-2);
}
#view-auth .auth-logo span { color: var(--event-primary); }
#view-auth .auth-event-name {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--ob-text-primary);
  text-align: center;
  margin-bottom: var(--space-2);
}
#view-auth .auth-tagline {
  font-size: var(--text-base);
  color: var(--ob-text-secondary);
  text-align: center;
  margin-bottom: var(--space-10);
}
#view-auth .auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--ob-surface-1);
  border: 1px solid var(--ob-surface-2);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-6);
}
#view-auth .auth-card h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  margin-bottom: var(--space-2);
}
#view-auth .auth-card p {
  font-size: var(--text-sm);
  color: var(--ob-text-secondary);
  margin-bottom: var(--space-6);
  line-height: 1.6;
}

/* OTP step */
#view-auth .otp-inputs {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  margin: var(--space-6) 0;
}
#view-auth .otp-input {
  width: 48px; height: 56px;
  text-align: center;
  font-size: var(--text-xl);
  font-weight: 700;
  font-family: var(--font-display);
  background: var(--ob-surface-2);
  border: 2px solid var(--ob-surface-3);
  border-radius: var(--radius-md);
  color: var(--ob-text-primary);
  outline: none;
  transition: border-color var(--dur-fast);
}
#view-auth .otp-input:focus { border-color: var(--event-primary); }

/* ── Home Screen ─────────────────────────────────────────────── */
.home-hero {
  background:
    radial-gradient(ellipse 120% 60% at 50% 0%, rgba(232,97,10,0.2) 0%, transparent 65%),
    var(--ob-surface-1);
  padding: var(--space-8) var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--ob-surface-2);
}
.home-hero .greeting {
  font-size: var(--text-sm);
  color: var(--ob-text-secondary);
  margin-bottom: var(--space-1);
}
.home-hero .guest-name {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-6);
}
.countdown-block {
  background: var(--ob-surface-2);
  border: 1px solid var(--ob-surface-3);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.countdown-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ob-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-3);
}
.countdown-units {
  display: flex;
  gap: var(--space-4);
}
.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.countdown-unit .num {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 900;
  color: var(--event-primary);
  line-height: 1;
}
.countdown-unit .lbl {
  font-size: var(--text-xs);
  color: var(--ob-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.countdown-unit .sep {
  font-size: var(--text-2xl);
  font-weight: 900;
  color: var(--ob-surface-3);
  line-height: 1;
  align-self: flex-start;
  padding-top: 2px;
}

/* Quick actions grid */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  padding: var(--space-5);
}
.quick-card {
  background: var(--ob-surface-1);
  border: 1px solid var(--ob-surface-2);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: border-color var(--dur-fast), transform var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
}
.quick-card:active { transform: scale(0.97); border-color: var(--ob-surface-3); }
.quick-card .qc-icon { font-size: 28px; }
.quick-card .qc-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ob-text-primary);
}
.quick-card .qc-sub {
  font-size: var(--text-xs);
  color: var(--ob-text-muted);
}

/* ── Agenda Screen ───────────────────────────────────────────── */
.agenda-day-header {
  padding: var(--space-4) var(--space-5) var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ob-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.session-row {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--ob-surface-1);
  position: relative;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-fast);
}
.session-row:active { background: var(--ob-surface-1); }
.session-time {
  flex-shrink: 0;
  width: 52px;
  padding-top: 2px;
}
.session-time .time-start {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ob-text-secondary);
}
.session-time .time-end {
  font-size: var(--text-xs);
  color: var(--ob-text-muted);
}
.session-content { flex: 1; min-width: 0; }
.session-title {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-1);
  line-height: 1.3;
}
.session-speaker {
  font-size: var(--text-sm);
  color: var(--ob-text-secondary);
  margin-bottom: var(--space-2);
}
.session-meta {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.session-star {
  flex-shrink: 0;
  font-size: 20px;
  padding: var(--space-1);
  color: var(--ob-text-muted);
  transition: color var(--dur-fast) var(--ease-spring), transform var(--dur-fast) var(--ease-spring);
}
.session-star.starred { color: var(--ob-warning); transform: scale(1.2); }

/* ── Profile Screen ──────────────────────────────────────────── */
.profile-hero {
  background: var(--ob-surface-1);
  padding: var(--space-8) var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  border-bottom: 1px solid var(--ob-surface-2);
}
.profile-section {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.profile-section h3 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--ob-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
}

/* ── Networking Screen ───────────────────────────────────────── */
.match-card {
  margin: 0 var(--space-5);
  background: var(--ob-surface-1);
  border: 1px solid var(--ob-surface-2);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}
.match-score {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: var(--ob-brand-subtle);
  border: 1px solid var(--ob-brand-border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--event-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
