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

:root {
  --primary: #8B1A1A;
  --bg: #FAF8F5;
  --text: #2C2C2C;
  --gold: #C9973A;
  --teal: #1A8B8B;
  --green: #1A6B3A;
  --blue: #1A4A8B;
  --purple: #6B3A9A;
  --border: #E8E4DE;
  --card-bg: #FFFFFF;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 12px;
  --header-h: 56px;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: 'Outfit', sans-serif; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Page header ── */
.page-header {
  background: var(--primary);
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-h);
}
.page-header h1 { font-size: 1.2rem; color: white; }
.page-header a  { color: rgba(255,255,255,0.85); font-size: 0.9rem; }
.page-header a:hover { color: white; text-decoration: none; }

.header-brand h1 { font-size: 1.2rem; line-height: 1.2; }
.header-tagline  { font-size: 0.72rem; color: rgba(255,255,255,0.65); display: block; }
.header-nav      { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.signout-link    { font-size: 0.78rem !important; color: rgba(255,255,255,0.55) !important; }

/* ── Layout ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px 40px; }

/* ── Auth pages ── */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.auth-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 28px;
  width: 100%;
  max-width: 440px;
}
.auth-card .logo { font-family: 'Outfit', sans-serif; font-size: 1.4rem; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.auth-card h2    { font-size: 1.3rem; margin-bottom: 6px; }
.auth-card .subtext { color: #777; font-size: 0.9rem; margin-bottom: 24px; line-height: 1.5; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 6px; color: #555; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  background: white;
  color: var(--text);
  transition: border-color 0.15s;
  -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 80px; }
.char-count { font-size: 0.75rem; color: #aaa; float: right; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 20px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; border: none;
  transition: opacity 0.15s, transform 0.1s;
  min-height: 48px;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: white; width: 100%; }
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-danger    { background: #c0392b; color: white; }
.btn-outline-white { background: transparent; color: white; border: 1.5px solid rgba(255,255,255,0.6); font-family: 'DM Sans', sans-serif; }
.btn:disabled  { opacity: 0.5; cursor: not-allowed; }

/* ── Messages ── */
.msg { padding: 12px 16px; border-radius: 8px; font-size: 0.9rem; margin-top: 12px; display: none; }
.msg.error   { background: #fdecea; color: #c0392b; display: block; }
.msg.success { background: #e8f5e9; color: #1a6b3a; display: block; }

/* ── OTP inputs ── */
.otp-row { display: flex; gap: 8px; justify-content: center; margin: 24px 0; }
.otp-row input {
  width: 44px; height: 56px;
  text-align: center; font-size: 1.4rem; font-weight: 700;
  font-family: 'Outfit', sans-serif;
  border: 2px solid var(--border); border-radius: 8px; padding: 0;
  -webkit-appearance: none;
}
.otp-row input:focus { border-color: var(--primary); outline: none; }

/* ── Photo upload ── */
.photo-upload-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 24px; }
.photo-preview {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: var(--primary) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Outfit', sans-serif; font-size: 2rem; font-weight: 700;
  color: white; cursor: pointer;
  overflow: hidden; border: 3px solid white; box-shadow: var(--shadow);
}
.photo-btn-row { display: flex; gap: 10px; }
.photo-btn {
  padding: 9px 18px;
  border-radius: 8px; border: 1.5px solid var(--border);
  background: white; color: var(--primary);
  font-family: 'DM Sans', sans-serif; font-size: 0.88rem; font-weight: 500;
  cursor: pointer; min-height: 44px;
  transition: border-color 0.15s, background 0.15s;
  touch-action: manipulation;
}
.photo-btn:hover { border-color: var(--primary); background: #fdf8f8; }

/* ── Phone input with prefix ── */
.label-optional { font-size: 0.75rem; color: #aaa; font-weight: 400; }
.phone-input-wrap {
  display: flex; align-items: center;
  border: 1.5px solid var(--border); border-radius: 8px; background: white;
  overflow: hidden; transition: border-color 0.15s;
}
.phone-input-wrap:focus-within { border-color: var(--primary); }
.phone-prefix {
  padding: 12px 12px; font-size: 0.95rem; color: #555;
  background: #f5f3f0; border-right: 1.5px solid var(--border);
  user-select: none; flex-shrink: 0; font-family: 'DM Sans', sans-serif;
}
.phone-input-wrap input {
  border: none !important; border-radius: 0 !important; box-shadow: none !important;
  flex: 1; padding: 12px 14px !important;
}
.phone-input-wrap input:focus { outline: none; }

/* ── Camera modal ── */
.camera-modal {
  position: fixed; inset: 0; background: #000; z-index: 200;
  display: none; flex-direction: column; align-items: center; justify-content: center;
}
.camera-modal.active { display: flex; }
.camera-video { width: 100%; max-height: 75vh; object-fit: cover; }
.camera-controls { display: flex; align-items: center; gap: 20px; padding: 24px 16px; }
.btn-capture {
  width: 72px; height: 72px; border-radius: 50%;
  background: white; border: 5px solid rgba(255,255,255,0.4);
  cursor: pointer; transition: transform 0.1s; flex-shrink: 0;
  touch-action: manipulation;
}
.btn-capture:active { transform: scale(0.93); }

/* ── Track selector ── */
.track-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.track-option {
  padding: 9px 16px; border-radius: 20px;
  border: 1.5px solid var(--border); background: white; color: var(--text);
  font-family: 'DM Sans', sans-serif; font-size: 0.88rem; font-weight: 500;
  cursor: pointer; transition: all 0.12s; min-height: 40px;
  touch-action: manipulation;
}
.track-option:hover    { border-color: var(--primary); }
.track-option.selected { background: var(--primary); color: white; border-color: var(--primary); }

/* ── Tags/chips ── */
.tag-input-wrap {
  display: flex; flex-wrap: wrap; gap: 6px;
  border: 1.5px solid var(--border); border-radius: 8px; padding: 8px;
  background: white; min-height: 48px; cursor: text;
}
.tag-input-wrap:focus-within { border-color: var(--primary); }
.tag { display: inline-flex; align-items: center; gap: 4px; background: #f0ece6; border-radius: 20px; padding: 4px 10px; font-size: 0.82rem; }
.tag button { background: none; border: none; cursor: pointer; color: #888; padding: 0; font-size: 1rem; line-height: 1; }
.tag-input-inner { border: none; outline: none; font-size: 0.9rem; flex: 1; min-width: 80px; background: transparent; font-family: 'DM Sans', sans-serif; }

/* ── Looking-for checks ── */
.lf-checks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.lf-option {
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
  font-size: 0.88rem; border: 1.5px solid var(--border); border-radius: 20px;
  padding: 7px 14px; background: white; color: var(--text);
  transition: all 0.12s; min-height: 40px; touch-action: manipulation;
}
.lf-option:hover   { border-color: var(--primary); }
.lf-option.selected { background: var(--primary); color: white; border-color: var(--primary); }

/* ── Filter sections ── */
.filter-section { margin-top: 12px; }
.filter-section-label { font-size: 0.73rem; text-transform: uppercase; letter-spacing: 0.08em; color: #aaa; font-weight: 600; margin-bottom: 6px; }
.filter-row {
  display: flex; gap: 8px; flex-wrap: nowrap;
  overflow-x: auto; padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  padding: 8px 14px; border-radius: 20px; border: 1.5px solid var(--border);
  background: white; font-size: 0.82rem; font-family: 'DM Sans', sans-serif;
  cursor: pointer; transition: all 0.12s; white-space: nowrap;
  min-height: 40px; flex-shrink: 0; touch-action: manipulation;
}
.filter-chip.active { background: var(--primary); color: white; border-color: var(--primary); }
.results-count { font-size: 0.8rem; color: #999; margin-top: 8px; padding-top: 4px; }

/* ── Search ── */
.search-bar-wrap { padding: 16px 0 0; }
.search-bar {
  width: 100%; padding: 13px 18px;
  border: 1.5px solid var(--border); border-radius: 30px;
  font-size: 1rem; background: white; font-family: 'DM Sans', sans-serif;
  -webkit-appearance: none;
}
.search-bar:focus { outline: none; border-color: var(--primary); }

/* ── Directory grid ── */
.directory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px; padding: 16px 0;
}
@media (max-width: 820px)  { .directory-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .directory-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 14px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  transition: transform 0.15s, box-shadow 0.15s; cursor: pointer;
}
@media (hover: hover) {
  .card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
}
.card:active { transform: scale(0.98); }

.card-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--primary) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Outfit', sans-serif; font-size: 1.4rem;
  font-weight: 700; color: white;
  margin-bottom: 10px; flex-shrink: 0; overflow: hidden;
}
.card-name { font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.card-bio  { font-size: 0.78rem; color: #666; margin-bottom: 8px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.chip-row { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-bottom: 6px; }
.chip {
  display: inline-block; padding: 3px 9px; border-radius: 20px;
  font-size: 0.7rem; font-weight: 500; white-space: nowrap;
}
.chip.faculty  { background: #FDF3DC; color: var(--gold); }
.chip.ta       { background: #DCF3F3; color: var(--teal); }
.chip.founder  { background: #DCF3E4; color: var(--green); }
.chip.aspiring { background: #DCE8F3; color: var(--blue); }
.chip.industry { background: #f0ece6; color: #555; }
.chip.interest { background: #f5f0fb; color: var(--purple); }
.chip.looking  { background: #fdf0f0; color: var(--primary); }
.chip.track    { background: #e8f0fd; color: var(--blue); }

.card .btn-link {
  margin-top: auto; padding-top: 10px; font-size: 0.82rem;
  color: var(--primary); font-weight: 600;
}

/* ── Profile detail ── */
.profile-page { max-width: 640px; margin: 0 auto; padding: 20px 16px 60px; }
.profile-hero {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 28px 0 20px;
}
.profile-avatar {
  width: 100px; height: 100px; border-radius: 50%;
  background: var(--primary) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Outfit', sans-serif; font-size: 2.2rem;
  font-weight: 700; color: white;
  margin-bottom: 14px; overflow: hidden;
}
.profile-name { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.social-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.social-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; font-size: 0.85rem; font-weight: 500;
  border: 1.5px solid var(--border); background: white; color: var(--text);
  text-decoration: none; transition: border-color 0.15s; min-height: 44px;
}
.social-btn:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

.section-card { background: var(--card-bg); border-radius: var(--radius); padding: 20px; margin-bottom: 14px; box-shadow: var(--shadow); }
.section-card h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: #aaa; margin-bottom: 12px; }

/* ── Welcome banner ── */
.welcome-banner {
  background: linear-gradient(135deg, var(--primary), #6B1010);
  color: white; border-radius: var(--radius); padding: 20px 24px;
  margin-bottom: 28px; text-align: center;
}
.welcome-banner h2 { font-size: 1.2rem; margin-bottom: 6px; }
.welcome-banner p  { font-size: 0.88rem; opacity: 0.85; }

/* ── Resend link ── */
.resend-wrap { text-align: center; margin-top: 16px; font-size: 0.88rem; color: #888; }
.resend-wrap a { color: var(--primary); cursor: pointer; }
.resend-wrap a.disabled { color: #aaa; pointer-events: none; }

/* ── Form page wrapper ── */
.form-page { max-width: 560px; margin: 0 auto; padding: 24px 16px 60px; }

/* ── Admin table ── */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.admin-table th { text-align: left; padding: 10px; border-bottom: 2px solid var(--border); font-weight: 600; }
.admin-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:hover td { background: #faf8f5; }

/* ── Mobile tweaks ── */
@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; }
  .otp-row input { width: 40px; height: 52px; font-size: 1.3rem; gap: 6px; }
  .profile-page { padding: 16px 12px 60px; }
  .form-page { padding: 20px 12px 60px; }
  .section-card { padding: 16px; }
  .welcome-banner { padding: 16px; }
  .photo-btn { font-size: 0.82rem; padding: 8px 14px; }
  .header-tagline { display: none; }
  .track-option { font-size: 0.82rem; padding: 8px 12px; }
}
