/* =============================================
   findoctors.in — Design System
   Stack: UIkit 3 + custom layer
   Font: DM Serif Display + DM Sans
============================================= */

/* ===== TOKENS ===== */
:root {
  /* Brand */
  --fd-green:       #0d9e6e;
  --fd-green-light: #e6f7f1;
  --fd-green-dark:  #0a7a54;
  --fd-green-mid:   #16b87f;
  --fd-teal:        #0891b2;

  /* Neutrals */
  --fd-ink:         #0f1923;
  --fd-ink-2:       #2d3a47;
  --fd-ink-3:       #4a5568;
  --fd-muted:       #718096;
  --fd-border:      #e2e8f0;
  --fd-bg:          #f7f9fb;
  --fd-surface:     #ffffff;
  --fd-surface-2:   #f0f4f8;

  /* Feedback */
  --fd-red:         #e53e3e;
  --fd-amber:       #d97706;
  --fd-amber-light: #fef3c7;
  --fd-blue:        #3182ce;
  --fd-blue-light:  #ebf8ff;

  /* Typography */
  --fd-font-display: 'DM Serif Display', Georgia, serif;
  --fd-font-body:    'DM Sans', system-ui, sans-serif;

  /* Spacing */
  --fd-radius:    10px;
  --fd-radius-lg: 16px;
  --fd-shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --fd-shadow:    0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  --fd-shadow-lg: 0 12px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
}

/* ===== RESET / BASE ===== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--fd-font-body);
  background: var(--fd-bg);
  color: var(--fd-ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Override UIkit defaults */
.uk-button { font-family: var(--fd-font-body); }

/* ===== NAVBAR ===== */
.fd-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--fd-border);
}

.fd-nav-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.fd-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: var(--fd-font-display);
  font-size: 1.25rem;
  color: var(--fd-ink);
  white-space: nowrap;
}

.fd-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--fd-green);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-style: normal;
}

.fd-logo-icon-lg {
  width: 48px;
  height: 48px;
  font-size: 20px;
  border-radius: 14px;
}

.fd-logo-tld { color: var(--fd-green); }

.fd-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.fd-nav-link {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--fd-ink-3);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}

.fd-nav-link:hover { background: var(--fd-surface-2); color: var(--fd-ink); }

.fd-nav-link-highlight {
  color: var(--fd-green-dark);
  font-weight: 600;
}

.fd-nav-actions { display: flex; align-items: center; gap: 8px; }

.fd-burger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}

.fd-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--fd-ink);
  border-radius: 2px;
}

/* Mobile menu */
.fd-mobile-menu {
  position: fixed;
  inset: 60px 0 0;
  background: var(--fd-surface);
  z-index: 99;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--fd-border);
}

.fd-mobile-menu a {
  padding: 12px 16px;
  color: var(--fd-ink);
  text-decoration: none;
  border-radius: var(--fd-radius);
  font-weight: 500;
}

.fd-mobile-menu a:hover { background: var(--fd-surface-2); }

/* ===== BUTTONS ===== */
.fd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--fd-radius);
  font-family: var(--fd-font-body);
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background .15s, box-shadow .15s, transform .1s, color .15s, border-color .15s;
  white-space: nowrap;
}

.fd-btn:active { transform: translateY(1px); }

.fd-btn-primary {
  background: var(--fd-green);
  color: #fff;
  border-color: var(--fd-green);
}
.fd-btn-primary:hover { background: var(--fd-green-dark); border-color: var(--fd-green-dark); color: #fff; }

.fd-btn-ghost {
  background: transparent;
  color: var(--fd-ink-2);
  border-color: var(--fd-border);
}
.fd-btn-ghost:hover { background: var(--fd-surface-2); color: var(--fd-ink); }

.fd-btn-outline {
  background: transparent;
  color: var(--fd-green-dark);
  border-color: var(--fd-green);
}
.fd-btn-outline:hover { background: var(--fd-green-light); }

.fd-btn-danger {
  background: var(--fd-red);
  color: #fff;
  border-color: var(--fd-red);
}
.fd-btn-danger:hover { opacity: .9; }

.fd-btn-sm { padding: 6px 14px; font-size: .82rem; }
.fd-btn-lg { padding: 13px 28px; font-size: 1rem; }

.fd-btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--fd-border);
  border-radius: 8px;
  background: none;
  cursor: pointer;
  font-size: .82rem;
  color: var(--fd-muted);
  font-family: var(--fd-font-body);
  transition: background .15s, color .15s;
}
.fd-btn-icon:hover { background: var(--fd-surface-2); color: var(--fd-ink); }

/* ===== SEARCH BAR ===== */
.fd-search-bar {
  display: flex;
  align-items: center;
  background: var(--fd-surface);
  border: 2px solid var(--fd-border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}

.fd-search-bar:focus-within {
  border-color: var(--fd-green);
  box-shadow: 0 0 0 3px rgba(13,158,110,.12);
}

.fd-search-icon {
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--fd-muted);
  flex-shrink: 0;
}

.fd-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--fd-font-body);
  font-size: 1rem;
  padding: 13px 0;
  background: transparent;
  color: var(--fd-ink);
  min-width: 0;
}

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

.fd-search-btn {
  margin: 5px;
  border-radius: 10px !important;
  flex-shrink: 0;
}

/* ===== CHIPS ===== */
.fd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.fd-chips-centered { justify-content: center; }

.fd-chip {
  display: inline-flex;
  padding: 6px 14px;
  background: var(--fd-surface);
  border: 1px solid var(--fd-border);
  border-radius: 999px;
  font-size: .82rem;
  font-family: var(--fd-font-body);
  color: var(--fd-ink-3);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.fd-chip:hover {
  background: var(--fd-green-light);
  border-color: var(--fd-green);
  color: var(--fd-green-dark);
}

/* ===== CARDS ===== */
.fd-card {
  background: var(--fd-surface);
  border: 1px solid var(--fd-border);
  border-radius: var(--fd-radius-lg);
  padding: 24px;
  box-shadow: var(--fd-shadow-sm);
}

.fd-card-subtle {
  background: var(--fd-surface-2);
  border-color: transparent;
}

/* ===== HERO ===== */
.fd-hero {
  padding: 72px 0 64px;
  background: linear-gradient(160deg, #f0faf5 0%, #e8f4fd 100%);
  border-bottom: 1px solid var(--fd-border);
  overflow: hidden;
}

.fd-hero .uk-container {
  max-width: 1200px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 48px;
  align-items: center;
}

.fd-hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  background: var(--fd-green-light);
  border: 1px solid rgba(13,158,110,.25);
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--fd-green-dark);
  margin-bottom: 20px;
}

.fd-hero-title {
  font-family: var(--fd-font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  color: var(--fd-ink);
  margin: 0 0 16px;
}

.fd-hero-title em {
  color: var(--fd-green);
  font-style: italic;
}

.fd-hero-sub {
  font-size: 1.05rem;
  color: var(--fd-ink-3);
  max-width: 500px;
  margin: 0 0 28px;
}

.fd-hero-search { max-width: 560px; }

/* Hero visual */
.fd-hero-visual {
  position: relative;
  height: 280px;
}

.fd-provider-card-preview {
  position: absolute;
  background: var(--fd-surface);
  border: 1px solid var(--fd-border);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--fd-shadow);
  min-width: 220px;
  animation: floatCard 4s ease-in-out infinite;
}

.fd-card-1 { top: 20px; right: 0; animation-delay: 0s; }
.fd-card-2 { top: 120px; right: 30px; animation-delay: -1.3s; }
.fd-card-3 { top: 210px; right: 10px; animation-delay: -2.6s; }

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

.fd-pcp-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.fd-dot-green { background: #22c55e; }
.fd-dot-amber { background: #f59e0b; }

.fd-pcp-name  { font-weight: 600; font-size: .9rem; color: var(--fd-ink); }
.fd-pcp-spec  { font-size: .78rem; color: var(--fd-muted); margin-top: 2px; }
.fd-pcp-tag   { font-size: .72rem; color: var(--fd-green); font-weight: 600; margin-top: 4px; }

/* ===== STATS ===== */
.fd-stats {
  padding: 40px 0;
  background: var(--fd-surface);
  border-bottom: 1px solid var(--fd-border);
}

.fd-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.fd-stat { padding: 12px; border-right: 1px solid var(--fd-border); }
.fd-stat:last-child { border-right: none; }

.fd-stat-num {
  font-family: var(--fd-font-display);
  font-size: 2rem;
  color: var(--fd-green);
  line-height: 1;
}

.fd-stat-label {
  font-size: .8rem;
  color: var(--fd-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ===== SECTIONS ===== */
.fd-section { padding: 72px 0; }

.fd-section-header {
  text-align: center;
  margin-bottom: 48px;
}

.fd-section-title {
  font-family: var(--fd-font-display);
  font-size: 2rem;
  color: var(--fd-ink);
  margin: 0 0 10px;
}

.fd-section-sub {
  font-size: 1rem;
  color: var(--fd-muted);
}

.fd-how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 960px;
  margin: 0 auto;
}

.fd-how-step {
  padding: 28px;
  border-radius: var(--fd-radius-lg);
  background: var(--fd-surface);
  border: 1px solid var(--fd-border);
}

.fd-how-num {
  font-family: var(--fd-font-display);
  font-size: 2.5rem;
  color: var(--fd-border);
  line-height: 1;
  margin-bottom: 12px;
}

.fd-how-step h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fd-ink);
  margin: 0 0 8px;
}

.fd-how-step p { font-size: .9rem; color: var(--fd-ink-3); margin: 0; }

/* ===== COMMUNITY SECTION ===== */
.fd-community {
  padding: 64px 0;
  background: var(--fd-green);
}

.fd-community-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  max-width: 960px;
  margin: 0 auto;
}

.fd-community-text h2 {
  font-family: var(--fd-font-display);
  font-size: 2rem;
  color: #fff;
  margin: 0 0 12px;
}

.fd-community-text p { color: rgba(255,255,255,.85); max-width: 480px; margin: 0 0 24px; }

.fd-community-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.fd-community-actions .fd-btn-primary {
  background: #fff;
  color: var(--fd-green-dark);
  border-color: #fff;
}
.fd-community-actions .fd-btn-primary:hover { background: var(--fd-green-light); }

.fd-community-actions .fd-btn-ghost {
  border-color: rgba(255,255,255,.5);
  color: #fff;
}
.fd-community-actions .fd-btn-ghost:hover { background: rgba(255,255,255,.1); }

.fd-badge-ring {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 3px dashed rgba(255,255,255,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.9);
  font-weight: 700;
  font-size: .85rem;
  text-align: center;
  line-height: 1.4;
  flex-shrink: 0;
  animation: spinSlow 20s linear infinite;
}

@keyframes spinSlow { to { transform: rotate(360deg); } }

/* ===== FOOTER ===== */
.fd-footer {
  background: var(--fd-ink);
  color: rgba(255,255,255,.7);
  padding: 56px 0 24px;
}

.fd-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.fd-footer-brand .fd-logo-icon { background: var(--fd-green-mid); }
.fd-footer-brand strong { color: #fff; display: block; margin: 8px 0 6px; font-size: 1rem; }
.fd-footer-brand p { font-size: .85rem; margin: 0; line-height: 1.6; }

.fd-footer-links h5 {
  color: #fff;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 12px;
}

.fd-footer-links a {
  display: block;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  font-size: .88rem;
  padding: 3px 0;
  transition: color .15s;
}
.fd-footer-links a:hover { color: #fff; }

.fd-footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
}

/* ===== SEARCH PAGE ===== */
.fd-search-header {
  background: var(--fd-surface);
  border-bottom: 1px solid var(--fd-border);
  padding: 14px 0;
  position: sticky;
  top: 60px;
  z-index: 50;
}

.fd-search-header .uk-container {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1200px;
}

.fd-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fd-muted);
  text-decoration: none;
  font-size: .85rem;
  white-space: nowrap;
  transition: color .15s;
}
.fd-back-link:hover { color: var(--fd-ink); }

.fd-search-bar-page { flex: 1; max-width: 700px; }

.fd-results-container {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  max-width: 1200px;
  margin: 32px auto;
  padding-bottom: 64px;
  align-items: start;
}

/* Filters sidebar */
.fd-filters {
  background: var(--fd-surface);
  border: 1px solid var(--fd-border);
  border-radius: var(--fd-radius-lg);
  padding: 20px;
  position: sticky;
  top: 130px;
}

.fd-filters-title {
  font-weight: 600;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--fd-muted);
  margin: 0 0 16px;
}

.fd-filter-group { margin-bottom: 14px; }
.fd-filter-label { display: block; font-size: .82rem; font-weight: 600; color: var(--fd-ink-2); margin-bottom: 5px; }
.fd-filter-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--fd-border);
  border-radius: 8px;
  font-family: var(--fd-font-body);
  font-size: .88rem;
  color: var(--fd-ink);
  background: var(--fd-bg);
  outline: none;
  transition: border-color .15s;
}
.fd-filter-input:focus { border-color: var(--fd-green); }
.fd-filter-clear { margin-top: 8px; width: 100%; justify-content: center; }

/* Results */
.fd-results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: .88rem;
  color: var(--fd-muted);
}
.fd-results-hint { font-size: .8rem; }

/* States */
.fd-state-loading,
.fd-state-empty,
.fd-state-initial,
.fd-state-error {
  text-align: center;
  padding: 64px 24px;
}

.fd-state-icon { font-size: 3rem; margin-bottom: 16px; }

.fd-state-loading h3,
.fd-state-empty h3,
.fd-state-initial h3,
.fd-state-error h3 {
  font-family: var(--fd-font-display);
  font-size: 1.4rem;
  margin: 0 0 8px;
  color: var(--fd-ink);
}

.fd-state-loading p,
.fd-state-empty p,
.fd-state-initial p,
.fd-state-error p {
  color: var(--fd-muted);
  margin: 0 0 20px;
}

.fd-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--fd-border);
  border-top-color: var(--fd-green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Provider cards */
.fd-results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fd-provider-card {
  background: var(--fd-surface);
  border: 1px solid var(--fd-border);
  border-radius: var(--fd-radius-lg);
  padding: 20px;
  transition: box-shadow .2s, border-color .2s;
  animation: slideUp .3s ease both;
}

.fd-provider-card:hover {
  box-shadow: var(--fd-shadow);
  border-color: #c8d8e8;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fd-pc-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.fd-pc-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--fd-green-light);
  color: var(--fd-green-dark);
  font-family: var(--fd-font-display);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
}

.fd-pc-info { flex: 1; min-width: 0; }

.fd-pc-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--fd-ink);
  margin: 0 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fd-pc-spec {
  font-size: .82rem;
  color: var(--fd-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fd-relevance-badge {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
}

.fd-relevance-high { background: var(--fd-green-light); color: var(--fd-green-dark); }
.fd-relevance-mid  { background: var(--fd-amber-light); color: var(--fd-amber); }
.fd-relevance-low  { background: var(--fd-surface-2); color: var(--fd-muted); }

.fd-pc-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--fd-border);
}

.fd-pc-detail {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .88rem;
  color: var(--fd-ink-3);
}

.fd-pc-icon { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; color: var(--fd-muted); }

.fd-pc-phone { color: var(--fd-green-dark); text-decoration: none; font-weight: 500; }
.fd-pc-phone:hover { text-decoration: underline; }

.fd-pc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fd-verified-badge {
  font-size: .78rem;
  font-weight: 600;
  color: var(--fd-green-dark);
  background: var(--fd-green-light);
  padding: 3px 10px;
  border-radius: 999px;
}

.fd-unverified-badge {
  font-size: .78rem;
  color: var(--fd-muted);
  background: var(--fd-surface-2);
  padding: 3px 10px;
  border-radius: 999px;
}

.fd-pc-actions { display: flex; align-items: center; gap: 8px; }

.fd-load-more { text-align: center; padding: 24px 0; }

/* ===== MODAL (suggest edit) ===== */
.fd-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,25,35,.5);
  backdrop-filter: blur(4px);
  z-index: 200;
}

#suggest-modal {
  position: fixed;
  inset: 0;
  z-index: 201;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity .2s;
}

#suggest-modal.fd-modal-visible { opacity: 1; }

.fd-modal {
  background: var(--fd-surface);
  border-radius: var(--fd-radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--fd-shadow-lg);
  position: relative;
  z-index: 1;
  transform: translateY(10px);
  transition: transform .2s;
}

.fd-modal-visible .fd-modal { transform: translateY(0); }

.fd-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--fd-border);
}

.fd-modal-header h3 { margin: 0; font-size: 1rem; font-weight: 700; }

.fd-modal-close {
  background: none; border: none; font-size: 1rem; cursor: pointer;
  color: var(--fd-muted); padding: 4px 8px; border-radius: 6px;
}
.fd-modal-close:hover { background: var(--fd-surface-2); color: var(--fd-ink); }

.fd-modal-body { padding: 20px 24px; }
.fd-modal-provider-name { font-weight: 600; margin-bottom: 16px; color: var(--fd-ink-2); }
.fd-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--fd-border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ===== FORMS ===== */
.fd-form-group { margin-bottom: 16px; }
.fd-form-group-full { grid-column: 1 / -1; }

.fd-label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--fd-ink-2);
  margin-bottom: 5px;
}

.fd-label-required::after { content: ' *'; color: var(--fd-red); }
.fd-field-hint { display: block; font-size: .78rem; color: var(--fd-muted); margin-top: 4px; }
.fd-optional { font-weight: 400; color: var(--fd-muted); font-size: .8rem; }

.fd-input,
.fd-select,
.fd-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--fd-border);
  border-radius: var(--fd-radius);
  font-family: var(--fd-font-body);
  font-size: .92rem;
  color: var(--fd-ink);
  background: var(--fd-surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.fd-input:focus,
.fd-select:focus,
.fd-textarea:focus {
  border-color: var(--fd-green);
  box-shadow: 0 0 0 3px rgba(13,158,110,.1);
}

.fd-input-error { border-color: var(--fd-red) !important; }

.fd-textarea { resize: vertical; min-height: 80px; }

.fd-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23718096' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; cursor: pointer; }

/* ===== SUGGEST PAGE ===== */
.fd-suggest-page { padding: 32px 0 64px; }

.fd-suggest-header { margin-bottom: 32px; }

.fd-page-title {
  font-family: var(--fd-font-display);
  font-size: 1.8rem;
  color: var(--fd-ink);
  margin: 12px 0 8px;
}

.fd-page-sub { color: var(--fd-muted); max-width: 560px; margin: 0; }

.fd-suggest-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  align-items: start;
}

.fd-form-section { margin-bottom: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--fd-border); }
.fd-form-section:last-of-type { border-bottom: none; }

.fd-form-section-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--fd-muted);
  margin: 0 0 16px;
}

.fd-form-row { display: grid; gap: 14px; }
.fd-form-row-2 { grid-template-columns: 1fr 1fr; }

.fd-form-submit { padding-top: 8px; }
.fd-submit-note { font-size: .8rem; color: var(--fd-muted); margin-top: 10px; }

.fd-auth-gate {
  text-align: center;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.fd-auth-gate-icon { font-size: 2.5rem; margin-bottom: 8px; }
.fd-auth-gate h3 { margin: 0; font-size: 1.1rem; }
.fd-auth-gate p { color: var(--fd-muted); max-width: 320px; margin: 4px 0 16px; }

/* Sidebar */
.fd-suggest-sidebar { display: flex; flex-direction: column; gap: 16px; }

.fd-sidebar-card {
  background: var(--fd-surface);
  border: 1px solid var(--fd-border);
  border-radius: var(--fd-radius-lg);
  padding: 20px;
}

.fd-sidebar-card-alt { background: var(--fd-green-light); border-color: rgba(13,158,110,.2); }
.fd-sidebar-card h4 { margin: 0 0 12px; font-size: .9rem; font-weight: 700; color: var(--fd-ink); }
.fd-sidebar-card p { font-size: .85rem; color: var(--fd-ink-3); margin: 0 0 12px; }

.fd-sidebar-list { margin: 0; padding-left: 16px; }
.fd-sidebar-list li { font-size: .85rem; color: var(--fd-ink-3); margin-bottom: 6px; }

.fd-mini-stats { display: flex; flex-direction: column; gap: 8px; }
.fd-mini-stats div { display: flex; gap: 6px; align-items: baseline; font-size: .88rem; }
.fd-mini-stats strong { color: var(--fd-green-dark); font-weight: 700; }
.fd-mini-stats span { color: var(--fd-muted); font-size: .8rem; }

/* Success overlay */
.fd-success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,25,35,.6);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.fd-success-card {
  background: var(--fd-surface);
  border-radius: var(--fd-radius-lg);
  padding: 40px 32px;
  text-align: center;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--fd-shadow-lg);
}

.fd-success-icon {
  width: 60px; height: 60px;
  background: var(--fd-green);
  color: #fff;
  border-radius: 50%;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.fd-success-card h2 { font-family: var(--fd-font-display); font-size: 1.6rem; margin: 0 0 10px; }
.fd-success-card p { color: var(--fd-muted); margin: 0 0 24px; }
.fd-success-actions { display: flex; gap: 10px; justify-content: center; }

/* ===== AUTH PAGE ===== */
.fd-auth-page {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  background: linear-gradient(160deg, #f0faf5 0%, #e8f4fd 100%);
}

.fd-auth-card {
  background: var(--fd-surface);
  border: 1px solid var(--fd-border);
  border-radius: var(--fd-radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--fd-shadow-lg);
}

.fd-auth-brand {
  text-align: center;
  margin-bottom: 28px;
}

.fd-auth-title {
  font-family: var(--fd-font-display);
  font-size: 1.7rem;
  margin: 12px 0 6px;
}

.fd-auth-sub { color: var(--fd-muted); font-size: .9rem; margin: 0; }

.fd-auth-providers { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }

.fd-oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--fd-radius);
  font-weight: 600;
  font-size: .92rem;
  text-decoration: none;
  transition: background .15s, box-shadow .15s;
  border: 1.5px solid var(--fd-border);
}

.fd-oauth-google {
  background: #fff;
  color: var(--fd-ink);
}
.fd-oauth-google:hover { background: var(--fd-bg); box-shadow: var(--fd-shadow-sm); }

.fd-oauth-github {
  background: #24292e;
  color: #fff;
  border-color: #24292e;
}
.fd-oauth-github:hover { background: #1a1f23; }

.fd-auth-note {
  font-size: .78rem;
  color: var(--fd-muted);
  text-align: center;
  margin: 0 0 20px;
  line-height: 1.5;
}

.fd-auth-divider {
  text-align: center;
  position: relative;
  margin-bottom: 16px;
}

.fd-auth-divider::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  border-top: 1px solid var(--fd-border);
}

.fd-auth-divider span {
  background: var(--fd-surface);
  padding: 0 12px;
  position: relative;
  font-size: .8rem;
  color: var(--fd-muted);
}

.fd-auth-skip {
  display: block;
  text-align: center;
  font-size: .88rem;
  color: var(--fd-green-dark);
  text-decoration: none;
  font-weight: 500;
}
.fd-auth-skip:hover { text-decoration: underline; }

/* ===== ALERTS ===== */
.fd-alert {
  padding: 12px 16px;
  border-radius: var(--fd-radius);
  font-size: .88rem;
  margin-bottom: 16px;
}

.fd-alert-error { background: #fff5f5; border: 1px solid #feb2b2; color: var(--fd-red); }
.fd-alert-info  { background: var(--fd-blue-light); border: 1px solid #bee3f8; color: var(--fd-blue); }
.fd-alert-info a { color: var(--fd-blue); font-weight: 600; }

/* ===== ACCOUNT PAGE ===== */
.fd-account-page { padding: 40px 0 64px; }

.fd-account-layout {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fd-account-profile { margin-bottom: 4px; }

.fd-profile-loading { display: flex; align-items: center; gap: 16px; }
.fd-skeleton { background: var(--fd-border); border-radius: 8px; animation: shimmer 1.5s ease-in-out infinite alternate; }
.fd-skeleton-avatar { width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0; }
.fd-skeleton-text { height: 14px; width: 180px; margin-bottom: 8px; }
.fd-skeleton-short { width: 100px; }
@keyframes shimmer { to { opacity: .5; } }

.fd-profile-inner { display: flex; align-items: center; gap: 16px; }

.fd-profile-avatar {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--fd-green-light);
  color: var(--fd-green-dark);
  font-family: var(--fd-font-display);
  font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

.fd-profile-name { font-size: 1.2rem; font-weight: 700; margin: 0 0 6px; }

.fd-profile-meta { display: flex; gap: 8px; align-items: center; }

.fd-provider-badge {
  font-size: .75rem;
  background: var(--fd-surface-2);
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--fd-muted);
  font-weight: 600;
  text-transform: capitalize;
}

.fd-tier-badge {
  font-size: .75rem;
  background: var(--fd-green-light);
  color: var(--fd-green-dark);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}

.fd-section-card-title {
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 16px;
  color: var(--fd-ink);
}

.fd-contrib-empty { text-align: center; padding: 24px; }
.fd-contrib-empty p { color: var(--fd-muted); margin: 0 0 14px; }

/* ===== ERROR PAGE ===== */
.fd-error-page {
  text-align: center;
  padding: 80px 24px;
}

.fd-error-code {
  font-family: var(--fd-font-display);
  font-size: 8rem;
  line-height: 1;
  color: var(--fd-border);
  margin-bottom: 16px;
}

.fd-error-title {
  font-family: var(--fd-font-display);
  font-size: 2rem;
  color: var(--fd-ink);
  margin: 0 0 10px;
}

.fd-error-sub { color: var(--fd-muted); margin: 0 0 28px; }
.fd-error-actions { display: flex; gap: 12px; justify-content: center; }

/* ===== TOAST ===== */
.fd-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  padding: 12px 24px;
  border-radius: var(--fd-radius);
  font-weight: 600;
  font-size: .9rem;
  z-index: 999;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  box-shadow: var(--fd-shadow-lg);
}

.fd-toast-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.fd-toast-success { background: var(--fd-green); color: #fff; }
.fd-toast-error   { background: var(--fd-red); color: #fff; }
.fd-toast-info    { background: var(--fd-ink); color: #fff; }

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  .fd-hero .uk-container { grid-template-columns: 1fr; }
  .fd-hero-visual { display: none; }
  .fd-how-grid { grid-template-columns: 1fr; gap: 16px; }
  .fd-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .fd-stat:nth-child(2) { border-right: none; }
  .fd-footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .fd-community-inner { flex-direction: column; text-align: center; }
  .fd-community-actions { justify-content: center; }
  .fd-badge-ring { display: none; }
  .fd-suggest-layout { grid-template-columns: 1fr; }
  .fd-suggest-sidebar { order: -1; }
}

@media (max-width: 680px) {
  .fd-nav-links { display: none; }
  .fd-results-container { grid-template-columns: 1fr; }
  .fd-filters { display: none; }
  .fd-form-row-2 { grid-template-columns: 1fr; }
  .fd-auth-card { padding: 28px 20px; }
  .fd-footer-grid { grid-template-columns: 1fr; }
  .fd-footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .fd-hero { padding: 48px 0 40px; }
  .fd-hero-search { max-width: 100%; }
  .fd-search-bar { flex-wrap: wrap; border-radius: 12px; }
  .fd-search-btn { margin: 0 5px 5px; width: calc(100% - 10px); }
}

/* ── Search page: initial/empty/error states should fill full width ── */
/* The results container is a 2-col grid. When showing a state (no      */
/* results yet), collapse the sidebar and let the state span full width. */

.fd-results-container:has(#state-initial:not([style*="display: none"])),
.fd-results-container:has(#state-initial:not([style*="display:none"])) {
  grid-template-columns: 1fr;
}

.fd-results-container:has(#state-initial:not([style*="display: none"])) .fd-filters,
.fd-results-container:has(#state-initial:not([style*="display:none"])) .fd-filters {
  display: none;
}

/* Simpler cross-browser fallback — always center the state panels */
.fd-state-initial,
.fd-state-empty,
.fd-state-error,
.fd-state-loading {
  grid-column: 1 / -1;   /* span all columns if in a grid */
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 80px 24px;
}

/* Make the results-main fill remaining space so states center in it */
.fd-results-main {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
}

.fd-results-main .fd-state-initial,
.fd-results-main .fd-state-empty,
.fd-results-main .fd-state-error,
.fd-results-main .fd-state-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 100%;
  margin: 0;
  padding: 40px 24px;
}

/* Results list should not flex-grow */
.fd-results-list { flex: 0 0 auto; }
.fd-load-more    { flex: 0 0 auto; }
.fd-results-meta { flex: 0 0 auto; }

/* ── Sticky footer (belt-and-suspenders for pages that don't use fd-page-wrap) ── */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body > .fd-page-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
}

body > .fd-page-wrap > main {
  flex: 1;
}

/* ── Auth page: ensure full height centering still works ── */
.fd-auth-page {
  flex: 1;
}