/* ============================================================
   Knot — Global School Clubs Directory
   ============================================================ */

:root {
  --bg: #06070d;
  --bg-elevated: #0d0f1a;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text-primary: #f4f5fb;
  --text-secondary: #a6acc4;
  --text-muted: #6c7290;

  --brand-tangerine: #ff7733;
  --brand-cinnabar: #e63b2e;
  --gradient-logo: linear-gradient(135deg, var(--brand-tangerine) 0%, var(--brand-cinnabar) 100%);

  --accent: var(--brand-tangerine);
  --accent-2: var(--brand-cinnabar);
  --accent-3: #ff6b9d;
  --gradient: var(--gradient-logo);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 0 1px rgba(255, 119, 51, 0.18), 0 20px 60px rgba(255, 119, 51, 0.18);

  --grid-line: rgba(255, 255, 255, 0.16);
  --grid-line-accent: rgba(255, 119, 51, 0.14);
  --navbar-bg: rgba(6, 7, 13, 0.72);

  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Space Grotesk", "Inter", system-ui, sans-serif;
}

/* Light theme — activated by [data-theme="light"] on <html>, set as early
   as possible (an inline script in <head>) to avoid a flash of dark theme. */
:root[data-theme="light"] {
  --bg: #f5f6fb;
  --bg-elevated: #ffffff;
  --surface: rgba(20, 21, 40, 0.035);
  --surface-hover: rgba(20, 21, 40, 0.065);
  --border: rgba(20, 21, 40, 0.1);
  --border-strong: rgba(20, 21, 40, 0.18);

  --text-primary: #14151f;
  --text-secondary: #4c5169;
  --text-muted: #767c94;

  --accent: var(--brand-tangerine);
  --accent-2: var(--brand-cinnabar);
  --accent-3: #db2f77;
  --gradient: var(--gradient-logo);

  --shadow-soft: 0 10px 40px rgba(20, 21, 45, 0.1);
  --shadow-glow: 0 0 0 1px rgba(255, 119, 51, 0.18), 0 20px 60px rgba(255, 119, 51, 0.14);

  --grid-line: rgba(20, 21, 40, 0.13);
  --grid-line-accent: rgba(230, 59, 46, 0.1);
  --navbar-bg: rgba(245, 246, 251, 0.72);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body.no-scroll {
  overflow: hidden;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

select, input {
  font-family: inherit;
}

.accent {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Background flourishes ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(var(--grid-line-accent) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-accent) 1px, transparent 1px);
  background-size: 56px 56px, 56px 56px, 224px 224px, 224px 224px;
  mask-image: radial-gradient(ellipse 150% 120% at 50% 0%, #000 72%, transparent 100%);
}

.bg-glow {
  position: fixed;
  z-index: -1;
  width: 900px;
  height: 900px;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.4;
  pointer-events: none;
}

.bg-glow--one {
  top: -280px;
  left: -220px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
}

.bg-glow--two {
  bottom: -300px;
  right: -260px;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 70%);
  opacity: 0.32;
}

.bg-glow--three {
  top: 50%;
  left: 50%;
  width: 1200px;
  height: 1200px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--accent) 0%, transparent 72%);
  opacity: 0.16;
}

body.intro-active {
  overflow: hidden;
}

/* ---------- Letter-by-letter reveal ---------- */
@keyframes letterIn {
  from {
    opacity: 0;
    transform: translateY(0.4em);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.4em);
  background-image: inherit;
  -webkit-background-clip: inherit;
  background-clip: inherit;
  color: inherit;
}

.word-wrap {
  display: inline-block;
  white-space: nowrap;
  background-image: inherit;
  -webkit-background-clip: inherit;
  background-clip: inherit;
  color: inherit;
}

.reveal-active .letter {
  animation: letterIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.reveal-instant .letter {
  animation: none;
  opacity: 1;
  transform: none;
}

/* ---------- Intro splash ---------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background: var(--bg);
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.65s ease;
}

.intro[hidden] {
  display: none;
}

.intro.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.intro__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 700px;
  height: 700px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.25;
  filter: blur(100px);
  pointer-events: none;
}

.intro__content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 24px;
}

.intro__mark {
  display: flex;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 12px;
}

.intro__mark .knot-icon {
  width: 2.6rem;
}

.intro__wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 10vw, 5.5rem);
  letter-spacing: -0.02em;
  background: var(--gradient-logo);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  min-height: 1.2em;
}

.intro__tagline {
  margin-top: 16px;
  max-width: 480px;
  font-size: clamp(0.95rem, 2.4vw, 1.1rem);
  color: var(--text-secondary);
  min-height: 1.6em;
}

.intro__skip {
  position: relative;
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0;
  animation: fadeInSkip 0.6s ease 1.4s forwards;
}

@keyframes fadeInSkip {
  to {
    opacity: 1;
  }
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px) saturate(160%);
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--border);
}

.navbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
}

.brand__mark {
  display: inline-flex;
  color: var(--accent);
}

.knot-icon {
  width: 1.3rem;
  height: auto;
  display: block;
}

.navbar__links {
  display: flex;
  gap: 28px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.navbar__links a {
  transition: color 0.2s ease;
}

.navbar__links a:hover {
  color: var(--text-primary);
}

.navbar__links-current {
  color: var(--text-primary);
  font-weight: 600;
  cursor: default;
}

.navbar__cta {
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--gradient);
  color: #0a0a12;
  font-weight: 600;
  font-size: 0.85rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.navbar__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255, 119, 51, 0.35);
}

@media (max-width: 760px) {
  .navbar__links { display: none; }
}

.navbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--surface-hover);
}

.theme-toggle__icon--sun {
  display: none;
}

.theme-toggle__icon--moon {
  display: block;
}

:root[data-theme="light"] .theme-toggle__icon--sun {
  display: block;
}

:root[data-theme="light"] .theme-toggle__icon--moon {
  display: none;
}

/* ---------- Auth: sign-in button & user chip ---------- */
.auth-signin-btn {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.85rem;
  background: var(--surface);
  transition: all 0.2s ease;
}

.auth-signin-btn:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.user-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.user-chip:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.user-chip__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient);
  color: #0a0a12;
  font-size: 0.92rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.user-chip__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-chip__name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-chip__caret {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.user-chip.is-open .user-chip__caret {
  transform: rotate(180deg);
}

.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 60;
}

.user-chip.is-open .user-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.user-menu__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.user-menu__name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-menu__email {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu__link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-primary);
  transition: background 0.2s ease;
}

.user-menu__link:hover {
  background: var(--surface-hover);
}

.user-menu__logout {
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--accent-3);
  transition: background 0.2s ease;
}

.user-menu__logout:hover {
  background: rgba(255, 107, 157, 0.1);
}

/* ---------- Auth modal ---------- */
.modal--auth {
  max-width: 420px;
  text-align: center;
  padding: 40px 36px;
}

.auth-step__mark {
  display: inline-block;
  font-size: 1.6rem;
  color: var(--accent);
  margin-bottom: 14px;
}

.auth-step h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.auth-step__sub {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 26px;
}

.google-btn-container {
  display: flex;
  justify-content: center;
  min-height: 40px;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 280px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: #fff;
  color: #1f1f1f;
  font-weight: 600;
  font-size: 0.88rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.google-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}

.google-btn[hidden] {
  display: none;
}

.auth-demo-note {
  margin-top: 16px;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.auth-demo-note code {
  color: var(--accent-2);
  background: rgba(230, 59, 46, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.72rem;
}

.auth-fineprint {
  margin-top: 24px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.auth-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--gradient);
  color: #0a0a12;
  font-weight: 700;
  font-size: 1.1rem;
}

.username-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  text-align: left;
  transition: border-color 0.2s ease;
}

.username-field:focus-within {
  border-color: var(--accent);
}

.username-field__prefix {
  color: var(--text-muted);
  font-weight: 600;
}

.username-field input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.username-field__status {
  font-size: 0.85rem;
  font-weight: 700;
  width: 16px;
  text-align: center;
}

.username-field__status--available {
  color: var(--accent-2);
}

.username-field__status--taken,
.username-field__status--invalid {
  color: var(--accent-3);
}

.username-hint {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: left;
}

.username-hint--error {
  color: var(--accent-3);
}

.auth-submit {
  width: 100%;
  margin-top: 22px;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  background: var(--gradient);
  color: #0a0a12;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(255, 119, 51, 0.35);
}

.auth-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- Simulated Google account picker ---------- */
.modal-overlay--picker {
  z-index: 110;
}

.google-picker {
  width: 100%;
  max-width: 360px;
  background: #fff;
  color: #1f1f1f;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.modal-overlay--picker.is-open .google-picker {
  transform: translateY(0) scale(1);
}

.google-picker__header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.google-picker__sub {
  font-size: 0.82rem;
  color: #5f6368;
  margin-bottom: 18px;
}

.google-picker__list {
  display: flex;
  flex-direction: column;
  border: 1px solid #dadce0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 10px;
}

.google-picker__list[hidden] {
  display: none;
}

.google-picker__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  width: 100%;
  text-align: left;
  border-bottom: 1px solid #ecedef;
  transition: background 0.15s ease;
  color: #1f1f1f;
}

.google-picker__item:last-child {
  border-bottom: none;
}

.google-picker__item:hover {
  background: #f6f7f9;
}

.google-picker__item[hidden] {
  display: none;
}

.google-picker__item--other {
  border: 1px solid #dadce0;
  border-radius: var(--radius-sm);
}

.google-picker__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8eaed;
  color: #3c4043;
  font-size: 0.72rem;
  font-weight: 700;
}

.google-picker__avatar--plus {
  background: #f1f3f4;
  font-size: 1rem;
  font-weight: 400;
}

.google-picker__name {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
}

.google-picker__email {
  display: block;
  font-size: 0.78rem;
  color: #5f6368;
}

.google-picker__other-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.google-picker__other-form[hidden] {
  display: none;
}

.google-picker__other-form input {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #dadce0;
  font-size: 0.88rem;
  outline: none;
  color: #1f1f1f;
  transition: border-color 0.2s ease;
}

.google-picker__other-form input:focus {
  border-color: #4285f4;
}

.google-picker__continue {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: #4285f4;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  align-self: flex-end;
}

.google-picker__continue:hover {
  background: #3367d6;
}

.hero--revealed .pill,
.hero--revealed .hero__subtitle,
.hero--revealed .hero__search,
.hero--revealed .hero__tags {
  opacity: 1;
  transform: none;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 96px 24px 64px;
  text-align: center;
}

.hero__inner {
  position: relative;
  z-index: 1;
}

.hero__decor {
  position: absolute;
  inset: -20px -40px auto -40px;
  height: 460px;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.hero__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.28;
  animation: heroBlobFloat 11s ease-in-out infinite;
}

.hero__blob--1 {
  width: 260px;
  height: 260px;
  left: 2%;
  top: 4%;
  background: var(--brand-tangerine);
}

.hero__blob--2 {
  width: 220px;
  height: 220px;
  right: 4%;
  top: 0;
  background: var(--brand-cinnabar);
  animation-delay: -3.5s;
}

.hero__blob--3 {
  width: 200px;
  height: 200px;
  left: 44%;
  bottom: -10%;
  background: var(--accent-2);
  opacity: 0.2;
  animation-delay: -7s;
}

@keyframes heroBlobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(16px, -20px) scale(1.07); }
}

.hero__geo {
  position: absolute;
  color: var(--accent);
  opacity: 0.5;
  animation: heroGeoFloat 7.5s ease-in-out infinite;
}

.hero__geo svg {
  display: block;
  width: 100%;
  height: 100%;
}

.hero__geo--1 { left: 6%; top: 16%; width: 34px; height: 34px; animation-delay: 0s; }
.hero__geo--2 { right: 8%; top: 22%; width: 22px; height: 22px; color: var(--accent-2); animation-delay: -2s; }
.hero__geo--3 { left: 14%; bottom: 6%; width: 26px; height: 26px; animation-delay: -4s; }
.hero__geo--4 { right: 12%; bottom: 10%; width: 18px; height: 18px; color: var(--accent-2); animation-delay: -5.5s; }

@keyframes heroGeoFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(8deg); }
}

@media (max-width: 720px) {
  .hero__decor { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__blob, .hero__geo { animation: none; }
}

.pill {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 12px var(--accent-2);
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
}

.hero__subtitle {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease 0.12s, transform 0.6s ease 0.12s;
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 40px;
}

.hero__search {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease 0.24s, transform 0.6s ease 0.24s;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hero__search:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.hero__search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.hero__search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.hero__search input::placeholder {
  color: var(--text-muted);
}

.hero__search-clear {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

.hero__search-clear:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.hero__tags {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease 0.36s, transform 0.6s ease 0.36s;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.tag-btn {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.tag-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: rgba(255, 119, 51, 0.1);
}

/* ---------- Stats ---------- */
.stats {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.stats__inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  border-radius: var(--radius-lg);
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.stat-card__value {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-card__label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

@media (max-width: 700px) {
  .stats__inner { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Explore ---------- */
.explore {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 100px;
}

.explore__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.explore__header h2 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  margin-bottom: 6px;
}

.explore__header h2::before,
.register__text h2::before,
.profile-section h3::before {
  content: "";
  display: block;
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: var(--gradient);
  margin-bottom: 12px;
}

.explore__header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.view-toggle__btn {
  padding: 9px 14px;
  color: var(--text-muted);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.view-toggle__btn.is-active {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* ---------- Filters ---------- */
.filters {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 20px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.filter-group select {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236c7290' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 32px;
}

.filter-group select:focus {
  border-color: var(--accent);
}

.filter-reset {
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  white-space: nowrap;
  transition: all 0.2s ease;
  height: fit-content;
}

.filter-reset:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--surface-hover);
}

@media (max-width: 900px) {
  .filters { grid-template-columns: repeat(2, 1fr); }
  .filter-reset { grid-column: 1 / -1; }
}

.results-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ---------- School grid & cards ---------- */
.school-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}

.school-grid--list {
  grid-template-columns: 1fr;
}

.school-grid--list .school-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
}

.school-grid--list .school-card__desc {
  display: none;
}

.school-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.school-card:hover,
.school-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(255, 119, 51, 0.45);
  background: var(--surface-hover);
  box-shadow: var(--shadow-glow);
  outline: none;
}

.school-card__media {
  position: relative;
  height: 108px;
  margin: -22px -22px 16px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.school-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.09) 0 2px, transparent 2px 16px);
}

.school-card__media--photo::after {
  background-image: linear-gradient(180deg, rgba(6, 7, 13, 0.05) 35%, rgba(6, 7, 13, 0.6) 100%);
}

.school-card__media-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flag-img {
  display: block;
  width: 1.3em;
  height: auto;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.flag-inline {
  display: inline-flex;
  vertical-align: -0.15em;
  margin-right: 6px;
}

.flag-inline .flag-img {
  width: 1.1em;
}

.school-card__club-count {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(10, 10, 18, 0.55);
  backdrop-filter: blur(6px);
  color: #fff;
  font-weight: 600;
}

.school-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  font-size: 0.68rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(10, 10, 18, 0.55);
  backdrop-filter: blur(6px);
  color: var(--accent-2);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.school-card__name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.school-card__location {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.school-card__desc {
  font-size: 0.87rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.school-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.school-grid--list .school-card__media {
  width: 64px;
  height: 64px;
  margin: 0;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.school-grid--list .school-card__club-count,
.school-grid--list .school-card__badge {
  display: none;
}

@keyframes cardHighlight {
  0%, 100% { box-shadow: var(--shadow-glow); border-color: rgba(230, 59, 46, 0.6); }
  50% { box-shadow: 0 0 0 1px rgba(230, 59, 46, 0.3), 0 20px 60px rgba(230, 59, 46, 0.25); border-color: rgba(230, 59, 46, 0.9); }
}

.school-card--new {
  animation: cardHighlight 1.1s ease-in-out 2;
}

.tag {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(230, 59, 46, 0.1);
  color: var(--accent-2);
  border: 1px solid rgba(230, 59, 46, 0.2);
}

.tag--muted {
  background: var(--surface);
  color: var(--text-muted);
  border-color: var(--border);
}

.school-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.school-card__cta {
  color: var(--accent-2);
  font-weight: 600;
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-secondary);
}

.empty-state__icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-family: var(--font-display);
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state p {
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.empty-state .filter-reset {
  display: inline-block;
}

/* ---------- Register CTA ---------- */
.register {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 100px;
}

.register__card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  padding: 44px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 119, 51, 0.12), rgba(230, 59, 46, 0.08));
  border: 1px solid var(--border-strong);
}

.register__text h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.register__text p {
  color: var(--text-secondary);
  max-width: 560px;
  font-size: 0.92rem;
}

.register__btn {
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  background: var(--gradient);
  color: #0a0a12;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.register__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(255, 119, 51, 0.35);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
}

.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer__brand .knot-icon {
  width: 1rem;
  color: var(--accent);
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 5, 10, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 36px;
  position: relative;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s ease;
  box-shadow: var(--shadow-soft);
}

.modal-overlay.is-open .modal {
  transform: translateY(0) scale(1);
}

.modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 5;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.modal__close:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.modal__media {
  position: relative;
  height: 140px;
  margin: -36px -36px 22px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.09) 0 2px, transparent 2px 16px);
}

.modal__media--photo::after {
  background-image: linear-gradient(180deg, rgba(6, 7, 13, 0.05) 35%, rgba(6, 7, 13, 0.6) 100%);
}

.modal__media-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal__badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  font-size: 0.7rem;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(10, 10, 18, 0.55);
  backdrop-filter: blur(6px);
  color: var(--accent-2);
  font-weight: 600;
}

.modal__header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-right: 40px;
}

.modal__header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 2px;
}

.modal__location {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.modal__submitted-by {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.modal__submitted-by strong {
  color: var(--accent-2);
  font-weight: 600;
}

.modal__website {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-2);
  transition: color 0.2s ease;
}

.modal__website:hover {
  color: var(--accent);
}

.modal__website[hidden] {
  display: none;
}

.modal__meta {
  display: flex;
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.modal__meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.modal__meta-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.modal__meta-value {
  font-weight: 600;
  font-size: 0.95rem;
}

.modal__description {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 26px;
}

.modal__clubs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal__clubs-header h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.modal__club-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.modal__clubs {
  display: grid;
  gap: 12px;
}

.club-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: var(--surface);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.club-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.club-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.club-card__header h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.club-card__category {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 119, 51, 0.14);
  color: #c9bfff;
  font-weight: 600;
}

.club-card__desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.club-card__meets {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.club-card__open-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(230, 59, 46, 0.14);
  color: var(--accent-2);
  font-weight: 600;
}

/* ---------- Club membership (join) ---------- */
.club-join {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.club-join__note {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.club-join__btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--gradient);
  color: #0a0a12;
  font-weight: 600;
  font-size: 0.8rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.club-join__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(255, 119, 51, 0.3);
}

.club-join__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.club-join__form input {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.club-join__form input:focus {
  border-color: var(--accent);
}

.club-join__actions {
  display: flex;
  gap: 8px;
}

.club-join__submit {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--gradient);
  color: #0a0a12;
  font-weight: 600;
  font-size: 0.8rem;
}

.club-join__cancel {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.club-join__cancel:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.club-join--done {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.club-join__check {
  color: var(--accent-2);
  font-weight: 700;
}

/* ---------- Register-a-school modal ---------- */
.modal--register {
  max-width: 640px;
}

.register-form__intro h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 6px;
  padding-right: 30px;
}

.register-form__intro p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 26px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field--full {
  grid-column: 1 / -1;
}

.form-field label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease;
  font-family: inherit;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--accent);
}

.form-field textarea {
  resize: vertical;
  min-height: 70px;
}

.form-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236c7290' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 32px;
}

/* ---------- Photo upload ---------- */
.photo-upload {
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.photo-upload:hover,
.photo-upload:focus-visible {
  border-color: var(--accent);
  background: var(--surface-hover);
  outline: none;
}

.photo-upload__preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 140px;
  color: var(--text-muted);
  text-align: center;
  padding: 12px;
}

.photo-upload__icon {
  color: var(--text-muted);
}

.photo-upload__text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.photo-upload__hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.photo-upload--has-image .photo-upload__preview {
  height: 160px;
  padding: 0;
  background-size: cover;
  background-position: center;
  position: relative;
}

.photo-upload--has-image .photo-upload__icon,
.photo-upload--has-image .photo-upload__hint {
  display: none;
}

.photo-upload--has-image .photo-upload__text {
  position: relative;
  z-index: 1;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(10, 10, 18, 0.6);
  backdrop-filter: blur(6px);
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.photo-upload--has-image:hover .photo-upload__text,
.photo-upload--has-image:focus-visible .photo-upload__text {
  opacity: 1;
}

.photo-upload--has-image .photo-upload__preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(6, 7, 13, 0.25);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.photo-upload--has-image:hover .photo-upload__preview::after,
.photo-upload--has-image:focus-visible .photo-upload__preview::after {
  opacity: 1;
}

.photo-upload__remove {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--accent-3);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

.photo-upload__remove:hover {
  background: rgba(255, 107, 157, 0.1);
}

.photo-upload__error {
  font-size: 0.78rem;
  color: var(--accent-3);
  margin-top: 6px;
}

.register-form__clubs-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 24px 0 12px;
}

.register-form__clubs-header h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.register-form__clubs-header span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.club-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 12px;
  background: var(--surface);
}

.club-row__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.club-row__grid input {
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
  text-align: left;
}

.club-row__grid input:focus {
  border-color: var(--accent);
}

.club-row__line {
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
  margin-bottom: 10px;
  font-family: inherit;
}

.club-row__line:focus {
  border-color: var(--accent);
}

.club-row__remove {
  font-size: 0.76rem;
  color: var(--accent-3);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

.club-row__remove:hover {
  background: rgba(255, 107, 157, 0.1);
}

.club-row__remove:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.add-club-btn {
  width: 100%;
  padding: 11px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all 0.2s ease;
  margin-bottom: 20px;
}

.add-club-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: rgba(255, 119, 51, 0.08);
}

.register-form__error {
  font-size: 0.82rem;
  color: var(--accent-3);
  margin-bottom: 14px;
  min-height: 1em;
}

.register-form__submit {
  width: 100%;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  background: var(--gradient);
  color: #0a0a12;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.register-form__submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(255, 119, 51, 0.35);
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .club-row__grid { grid-template-columns: 1fr; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-soft);
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-open {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast__icon {
  color: var(--accent-2);
  font-size: 1rem;
}

/* ---------- Profile page ---------- */
.profile-hero {
  padding-bottom: 48px;
}

.profile-guard {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 100px;
  display: flex;
  justify-content: center;
}

.profile-guard[hidden] {
  display: none;
}

.profile-guard__card {
  text-align: center;
  max-width: 420px;
  padding: 48px 36px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}

.profile-guard__icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 16px;
}

.profile-guard__card h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.profile-guard__card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.profile-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 100px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.profile-card__avatar {
  width: 112px;
  height: 112px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient);
  color: #0a0a12;
  font-weight: 700;
  font-size: 2.2rem;
  overflow: hidden;
}

.profile-card__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-avatar-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.profile-avatar-edit:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface-hover);
}

.profile-avatar-remove {
  margin-top: 4px;
  font-size: 0.76rem;
  color: var(--accent-3);
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

.profile-avatar-remove:hover {
  background: rgba(255, 107, 157, 0.1);
}

.profile-card h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 2px;
}

.profile-card__username {
  color: var(--accent-2);
  font-size: 0.88rem;
  font-weight: 600;
}

.profile-card__email {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  border-radius: var(--radius-lg);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 40px;
}

.profile-section {
  margin-bottom: 44px;
}

.profile-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.profile-section h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.profile-section__header .register__btn {
  padding: 10px 18px;
  font-size: 0.82rem;
  text-decoration: none;
  display: inline-block;
}

.profile-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.profile-schools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.profile-school {
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.profile-school:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.profile-school__media {
  position: relative;
  height: 90px;
  overflow: hidden;
}

.profile-school__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-school__body {
  padding: 16px 16px 8px;
}

.profile-school__body h4 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.profile-school__body p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.profile-school__actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px 16px;
}

.profile-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.profile-btn--edit {
  color: var(--accent-2);
}

.profile-btn--edit:hover {
  background: rgba(230, 59, 46, 0.1);
  border-color: rgba(230, 59, 46, 0.4);
}

.profile-btn--delete {
  color: var(--accent-3);
}

.profile-btn--delete:hover {
  background: rgba(255, 107, 157, 0.1);
  border-color: rgba(255, 107, 157, 0.4);
}

.profile-clubs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-club {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.profile-club__body {
  flex: 1;
  min-width: 0;
}

.profile-club__body h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.profile-club__body p {
  font-size: 0.8rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-club .profile-btn {
  flex: none;
  padding: 8px 16px;
}

@media (max-width: 560px) {
  .profile-card { flex-direction: column; text-align: center; }
  .profile-stats { grid-template-columns: 1fr; }
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .hero { padding: 72px 20px 48px; }
  .register__card { padding: 30px; }
  .modal { padding: 26px; }
}

/* ---------- Network page ---------- */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 18px;
}

.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.search-bar__icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-results[hidden] {
  display: none;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.search-result__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.search-result__body strong {
  font-size: 0.92rem;
}

.search-result__body span {
  font-size: 0.8rem;
  color: var(--accent-2);
}

.search-result .profile-btn {
  flex: none;
  padding: 8px 16px;
}

.friend-card__avatar {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient);
  color: #0a0a12;
  font-weight: 700;
  font-size: 1.05rem;
  overflow: hidden;
}

.friend-card__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.friend-card {
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.friend-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.friend-card__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.friend-card__header h4 {
  font-size: 1rem;
  margin-bottom: 2px;
}

.friend-card__header p {
  font-size: 0.8rem;
  color: var(--accent-2);
}

.friend-card__stats {
  display: flex;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.friend-card__section {
  margin-bottom: 14px;
}

.friend-card__section h5 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.friend-card__item {
  font-size: 0.84rem;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  margin-bottom: 6px;
}

.friend-card__item strong {
  color: var(--text-primary);
}

.friend-card__desc {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 2px;
}

.friend-card__actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.friend-card__actions .profile-btn {
  flex: 1;
}

.invites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.invite-card {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border-strong);
}

.invite-card p {
  font-size: 0.88rem;
  margin-bottom: 8px;
}

.invite-card__message {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 0.85rem !important;
}

.modal--invite {
  max-width: 460px;
}

@media (max-width: 560px) {
  .friends-grid, .invites-grid { grid-template-columns: 1fr; }
}
