/* ISOT Member App — Apple-Grade Design System
 * Inspired by Apple Wallet, Things 3, and iOS Settings.
 * Restrained dark surfaces, translucent glass materials, single pink accent (#EE0979).
 */

:root {
  /* Surface Tokens */
  --bg-dark:        #0F172A;
  --bg-card:        #1E293B;
  --bg-darker:      #0B1120;
  --surface-glass:  rgba(30, 41, 59, 0.75);
  --nav-glass:      rgba(15, 23, 42, 0.85);

  /* Accent Tokens — Pink is THE primary action accent */
  --pink:           #EE0979;
  --pink-glow:      rgba(238, 9, 121, 0.35);
  --navy:           #243673;
  --orange:         #FF6A00;
  --gold:           #D4AF50;
  --green:          #10B981;
  --red:            #EF4444;

  /* ISOT Identity Palette (Circles & Geometry) */
  --id-steel-blue:  #7397B1;
  --id-teal:        #3E6B7E;
  --id-amber:       #EBC17F;
  --id-deep-orange: #DE8E28;
  --id-terracotta:  #B64226;
  --id-mauve:       #A0689A;
  --id-lavender:    #BBC1F9;
  --id-indigo:      #3F35A0;

  /* Typography & Borders */
  --text-main:      #F8FAFC;
  --text-muted:     #CBD5E1;
  --text-dim:       #94A3B8;
  --text-dark:      #64748B;
  --border-light:   rgba(255, 255, 255, 0.12);
  --border-strong:  rgba(255, 255, 255, 0.22);
  --border-glow:    rgba(238, 9, 121, 0.4);

  --font-display:   'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:      'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-brand:     'Amatic SC', cursive, sans-serif;

  --radius-sm:      12px;
  --radius-md:      20px;
  --radius-lg:      32px;
  --radius-full:    9999px;

  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  touch-action: manipulation;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

input[type="text"], input[type="password"], input[type="email"], select, textarea {
  font-size: 16px !important;
  touch-action: manipulation;
}

/* ---------- Mobile Bottom Tab Bar (Apple Material) ---------- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--nav-glass);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-top: 1px solid var(--border-light);
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  padding-top: 10px;
}
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.82rem !important;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition-fast);
  padding: 6px 14px;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
}
.tab-item.active { color: var(--pink); font-weight: 700; }
.tab-item svg { width: 25px; height: 25px; stroke-width: 2.2; }

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  touch-action: manipulation;
}

/* ---------- Custom Thin Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--pink); }

a { color: inherit; text-decoration: none; }

/* ---------- Layout Shell ---------- */
.shell {
  max-width: 540px;
  margin: 0 auto;
  padding: 20px 18px calc(5rem + env(safe-area-inset-bottom));
  position: relative;
}
.shell-wide { max-width: 900px; }

/* ---------- Top Navigation Bar (Apple Material) ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  background: var(--nav-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: max(16px, env(safe-area-inset-top));
}
.topbar img { height: 26px; width: auto; }

.topbar-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #FFF;
}

/* ---------- Slide-In Burger Drawer (Apple Glass) ---------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
}
.drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(340px, 85vw);
  height: 100vh;
  height: 100dvh;
  background: rgba(18, 24, 38, 0.98);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border-left: 1px solid var(--border-light);
  z-index: 3001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
  padding-top: max(16px, env(safe-area-inset-top));
}
.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.drawer-user-card {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.drawer-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
}

.drawer-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pink);
  padding: 12px 12px 6px;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--transition-fast);
}
.drawer-item:hover, .drawer-item:active {
  background: rgba(255, 255, 255, 0.08);
  color: #FFF;
}
.drawer-item i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}

.drawer-footer {
  flex-shrink: 0;
  padding: 16px 20px max(24px, calc(16px + env(safe-area-inset-bottom)));
  border-top: 1px solid var(--border-light);
  background: rgba(18, 24, 38, 0.98);
}

/* ---------- Typography ---------- */
h1 {
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 1.1rem;
  font-weight: 600;
}
.muted { color: var(--text-muted); }
.dim   { color: var(--text-dim); font-size: 0.875rem; }
.eyebrow {
  color: var(--pink);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------- Apple Glass Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-fast);
}
.card + .card { margin-top: 16px; }
.card-glass {
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.card-glow {
  border-color: var(--border-glow);
  box-shadow: 0 0 30px rgba(238, 9, 121, 0.12);
}

/* ---------- Primary Actions (Pink Restraint) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 24px;
  min-height: 48px;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  touch-action: manipulation;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(0.98); }

.btn-pink {
  background: var(--pink);
  color: #FFF;
  box-shadow: 0 4px 18px var(--pink-glow);
}
.btn-pink:hover:not(:disabled) {
  background: #FF1A8B;
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-light);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
}
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  font-weight: 500;
}
.btn-ghost:hover:not(:disabled) { color: var(--text-main); }

/* ---------- Form Controls ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  background: var(--bg-darker);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: var(--transition-fast);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(238, 9, 121, 0.15);
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- Feedback Alerts ---------- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 16px;
}
.alert-error   { background: rgba(239, 68, 68, 0.15);  border: 1px solid rgba(239, 68, 68, 0.4);  color: #FCA5A5; }
.alert-success { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.4); color: #6EE7B7; }
.alert-info    { background: rgba(238, 9, 121, 0.12);  border: 1px solid var(--border-glow);       color: var(--text-muted); }
[hidden] { display: none !important; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.badge-socio       { background: var(--pink);  color: #FFF; }
.badge-participant { background: rgba(255,255,255,0.1); border: 1px solid var(--border-light); color: var(--text-muted); }
.badge-staff       { background: var(--gold);  color: var(--bg-dark); }
.badge-live        { background: var(--green); color: #FFF; animation: pulseGlow 2s infinite; }

@keyframes pulseGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}



/* ---------- Deterministic Geometry & Initials Avatars ---------- */
.geo-avatar {
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  border: 1px solid var(--border-light);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  flex-shrink: 0;
  text-align: center;
}

/* ---------- SVG Category Character Badges ---------- */
.cat-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  background: var(--bg-darker);
}
.cat-badge img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- PWA Gate Spinner ---------- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.2);
  border-top-color: #FFF;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Modal Backdrop & Glass Sheet Overlay ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  padding: 24px 20px max(24px, env(safe-area-inset-bottom)) 20px;
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.8);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 88vh;
  overflow-y: auto;
}

.modal-backdrop.active .modal-sheet {
  transform: translateY(0);
}

#gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  z-index: 9999;
}

/* Reduced Motion Kill Switch */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Apple-Grade Motion & Fluid Micro-Interactions System
   ========================================================================== */

/* 1. Tactile Tap Physics for Buttons, Cards & Tabs */
.btn, .btn-pink, .btn-outline, .btn-rsvp, .card, .event-card-item, .student-card, .tab-item, .filter-pill, .cat-pill-item {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background-color 0.2s ease, border-color 0.2s ease;
  will-change: transform;
}

.btn:active, .btn-pink:active, .btn-outline:active, .btn-rsvp:active, .tab-item:active, .filter-pill:active, .cat-pill-item:active {
  transform: scale(0.95);
}

.card:active, .event-card-item:active, .student-card:active {
  transform: scale(0.985);
}

/* 2. Fluid Page Entrance & Stagger Motion */
.shell > * {
  animation: appleFadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.shell > *:nth-child(1) { animation-delay: 0.03s; }
.shell > *:nth-child(2) { animation-delay: 0.08s; }
.shell > *:nth-child(3) { animation-delay: 0.13s; }
.shell > *:nth-child(4) { animation-delay: 0.18s; }
.shell > *:nth-child(5) { animation-delay: 0.23s; }

@keyframes appleFadeInUp {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 3. Ambient Pulsing Neon Glow Effects for Active & Live Badges */
.badge-live, .btn-rsvp.going {
  animation: ambientPulse 2.8s ease-in-out infinite alternate;
}

@keyframes ambientPulse {
  0% {
    box-shadow: 0 0 8px rgba(238, 9, 121, 0.25);
  }
  50% {
    box-shadow: 0 0 20px rgba(238, 9, 121, 0.65), 0 0 30px rgba(238, 9, 121, 0.25);
  }
  100% {
    box-shadow: 0 0 8px rgba(238, 9, 121, 0.25);
  }
}

/* 4. Glass Drawer Slide Entrance */
.drawer {
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

/* 5. Smooth Tabbar Active Indicator Bounce */
.tab-item.active svg {
  transform: translateY(-2px) scale(1.08);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}



/* ---------- Show/hide password ----------
   Attached automatically to every input[type=password] by initPasswordToggles()
   in isot.js, so any page that adds a password field gets it for free. */
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { padding-right: 46px; }
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 50%;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.pw-toggle:hover { color: var(--text-main); background: rgba(255,255,255,0.06); }
.pw-toggle:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.pw-toggle svg { width: 19px; height: 19px; stroke: currentColor; fill: none;
                 stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ==========================================================================
   Apple-Grade 3D Icon System (Volumetric Depth, Rim Lighting & Shadowing)
   ========================================================================== */

/* 1. Bottom Navigation Bar 3D SVG Icons */
.tab-item svg {
  width: 26px;
  height: 26px;
  stroke-width: 2.2;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
  transform: translateZ(0);
}

.tab-item.active svg {
  transform: translateY(-4px) scale(1.12);
  filter: drop-shadow(0 6px 14px rgba(238, 9, 121, 0.65)) drop-shadow(0 2px 4px rgba(255, 255, 255, 0.35));
}

.tab-item:active svg {
  transform: translateY(0) scale(0.92);
}

/* 2. 3D Depth & Drop-Shadows for FontAwesome Icons */
.btn i, .btn-rsvp i, .eyebrow i, .badge i, .topbar i, .settings-title i, .meta-pill i {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn:hover i, .btn-pink:hover i {
  transform: scale(1.12);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}

/* 3. 3D Rim Lighting & Volumetric Depth for Category & Member Badges */
.cat-pill-img, .cat-badge, .cat-box, .geo-avatar {
  box-shadow: 0 10px 24px -4px rgba(0, 0, 0, 0.55), inset 0 2px 4px rgba(255, 255, 255, 0.25), inset 0 -2px 6px rgba(0, 0, 0, 0.4);
  border: 1.5px solid rgba(255, 255, 255, 0.22) !important;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.cat-pill-item:hover .cat-pill-img, .cat-box:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 16px 32px -4px rgba(238, 9, 121, 0.35), inset 0 2px 6px rgba(255, 255, 255, 0.4);
}

/* 4. Topbar Bell & Burger Drawer 3D Depth */
#notifBellBtn i, #burgerBtn i {
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5));
  transition: transform 0.2s ease, filter 0.2s ease;
}
#notifBellBtn:hover i {
  transform: rotate(15deg) scale(1.15);
  filter: drop-shadow(0 4px 12px rgba(238, 9, 121, 0.6));
}
