/* ===========================
   DWF CONNECT — SHARED STYLES
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,500;0,9..144,700;1,9..144,400&family=Outfit:wght@300;400;500;600&display=swap');

:root {
  --teal:        #006D77;
  --teal-dark:   #004E57;
  --teal-light:  #E0F0F2;
  --gold:        #C9913A;
  --gold-light:  #F5E6CC;
  --cream:       #FAF8F4;
  --cream-dark:  #F0EDE6;
  --ink:         #1A1A1A;
  --ink-mid:     #444444;
  --ink-soft:    #888888;
  --white:       #FFFFFF;
  --border:      #DDD8CE;

  /* Role badge colours */
  --badge-pwd:   #006D77;   /* Person with Diabetes — teal */
  --badge-care:  #7B5EA7;   /* Caregiver — warm purple */
  --badge-edu:   #C9913A;   /* DWF Educator — gold */
  --badge-hcp:   #2A7D4F;   /* Healthcare Professional — forest */
  --badge-supp:  #5A6A7A;   /* Supporter — slate */

  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 2px 16px rgba(0,77,87,0.10);
  --shadow-lg:   0 8px 40px rgba(0,77,87,0.15);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  /* subtle grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  line-height: 1.2;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 50px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--teal);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,109,119,0.3);
  text-decoration: none;
  color: var(--white);
}
.btn-gold {
  background: var(--gold);
  color: var(--white);
}
.btn-gold:hover {
  background: #b07c2e;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(201,145,58,0.3);
  text-decoration: none;
  color: var(--white);
}
.btn-outline {
  background: transparent;
  border: 2px solid var(--teal);
  color: var(--teal);
}
.btn-outline:hover {
  background: var(--teal);
  color: var(--white);
  text-decoration: none;
}
.btn-ghost {
  background: transparent;
  color: var(--ink-mid);
  padding: 8px 16px;
}
.btn-ghost:hover { background: var(--cream-dark); text-decoration: none; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Card ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

/* ── Role Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: white;
}
.badge-pwd   { background: var(--badge-pwd); }
.badge-care  { background: var(--badge-care); }
.badge-edu   { background: var(--badge-edu); }
.badge-hcp   { background: var(--badge-hcp); }
.badge-supp  { background: var(--badge-supp); }

/* ── Nav ── */
.app-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,77,87,0.07);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--teal-dark);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo span { color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: 8px; }

/* ── Form elements ── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-mid);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--cream);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0,109,119,0.12);
  background: var(--white);
}
.form-input::placeholder { color: var(--ink-soft); }

textarea.form-input { resize: vertical; min-height: 100px; }

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 16px;
}
.alert-error { background: #FDECEA; color: #C62828; border: 1px solid #FFCDD2; }
.alert-success { background: #E8F5E9; color: #2E7D32; border: 1px solid #C8E6C9; }

/* ── Avatar ── */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1rem;
  color: white;
  flex-shrink: 0;
}

/* ── Utility ── */
.text-center { text-align: center; }
.text-soft   { color: var(--ink-soft); }
.text-gold   { color: var(--gold); }
.text-teal   { color: var(--teal); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

/* ── Divider ── */
.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink-soft); font-size: 0.85rem; margin: 20px 0;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .nav-inner { padding: 0 16px; }
}
