/* ─── FondBridge Design System ───────────────────────────────────────── */

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

:root {
  --ink: #0a0f1c;
  --cream: #f8f6f1;
  --accent: #1a5cff;
  --accent-light: #e8efff;
  --accent-dark: #0d3dbf;
  --gold: #c8a44e;
  --muted: #6b7280;
  --border: rgba(10, 15, 28, 0.08);
  --success: #16a34a;
  --success-light: #dcfce7;
  --error: #dc2626;
  --error-light: #fef2f2;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(10, 15, 28, 0.06);
  --shadow-md: 0 4px 16px rgba(10, 15, 28, 0.08);
  --shadow-lg: 0 8px 32px rgba(10, 15, 28, 0.12);
  --radius: 12px;
  --radius-lg: 16px;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ─── NAV ────────────────────────────────────────────────────────────── */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(248, 246, 241, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--ink);
  text-decoration: none !important;
}

.logo span {
  color: var(--accent);
}

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

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s;
  text-decoration: none !important;
}

.nav-link:hover {
  color: var(--ink);
  background: var(--white);
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-light);
}

/* ─── PAGE CONTAINER ────────────────────────────────────────────────── */

.page {
  padding: 100px 40px 60px;
  max-width: 800px;
  margin: 0 auto;
  min-height: 100vh;
}

.page-wide {
  max-width: 1100px;
}

.page-header {
  margin-bottom: 48px;
}

.page-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}

.page-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -1px;
  font-weight: 700;
  margin-bottom: 12px;
}

.page-subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 600px;
}

/* ─── FORM ───────────────────────────────────────────────────────────── */

.form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 40px;
  box-shadow: var(--shadow-sm);
}

.form-section {
  margin-bottom: 32px;
}

.form-section-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-row.single {
  grid-template-columns: 1fr;
}

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

.form-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
}

.form-label .required {
  color: var(--error);
  margin-left: 2px;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.form-input,
.form-select,
.form-textarea {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  padding: 10px 14px;
  border: 1.5px solid rgba(10, 15, 28, 0.12);
  border-radius: 10px;
  background: var(--cream);
  color: var(--ink);
  transition: all 0.2s;
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(26, 92, 255, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(107, 114, 128, 0.5);
}

.form-select {
  cursor: pointer;
  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='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

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

/* Checkbox grid for multi-select */
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1.5px solid rgba(10, 15, 28, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.88rem;
  user-select: none;
}

.checkbox-item:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.checkbox-item input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.checkbox-item.checked {
  border-color: var(--accent);
  background: var(--accent-light);
  font-weight: 500;
}

/* Input with suffix (EUR, %, etc) */
.input-with-suffix {
  position: relative;
}

.input-with-suffix .form-input {
  width: 100%;
  padding-right: 50px;
}

.input-suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.82rem;
  color: var(--muted);
  pointer-events: none;
}

/* ─── BUTTONS ────────────────────────────────────────────────────────── */

.btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  text-decoration: none !important;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
  background: var(--muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--white);
  color: var(--ink);
  border: 1.5px solid rgba(10, 15, 28, 0.12);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-lg {
  padding: 14px 36px;
  font-size: 1rem;
}

.form-actions {
  margin-top: 32px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ─── LOADING / STATUS ───────────────────────────────────────────────── */

.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.alert {
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.alert-error {
  background: var(--error-light);
  color: var(--error);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.alert-success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(22, 163, 74, 0.2);
}

/* ─── MATCH CARDS ────────────────────────────────────────────────────── */

.matches-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.match-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 28px;
  align-items: start;
  transition: transform 0.2s, box-shadow 0.2s;
}

.match-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.score-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: relative;
}

.score-circle::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    var(--accent) calc(var(--score) * 3.6deg),
    var(--accent-light) calc(var(--score) * 3.6deg)
  );
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 5px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 5px));
}

.score-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  z-index: 1;
}

.score-label {
  font-size: 0.65rem;
  color: var(--muted);
  z-index: 1;
}

.match-info h3 {
  font-size: 1.15rem;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.match-rank {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.match-thesis {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.match-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.meta-tag {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--cream);
  color: var(--ink);
  font-weight: 500;
}

.meta-tag.accent {
  background: var(--accent-light);
  color: var(--accent);
}

/* Score breakdown bars */
.breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
}

.breakdown-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.breakdown-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
}

.breakdown-bar {
  height: 5px;
  border-radius: 3px;
  background: var(--accent-light);
  overflow: hidden;
}

.breakdown-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.5s ease;
}

/* ─── EMPTY STATE ────────────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 60px 40px;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.empty-state h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.empty-state p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 500px;
  margin: 0 auto 24px;
}

/* ─── PROFILE SUMMARY CARD ──────────────────────────────────────────── */

.profile-summary {
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 32px;
}

.profile-summary h2 {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.profile-summary .subtitle {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 16px;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-tag {
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 6px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  font-weight: 500;
}

.profile-tag.highlight {
  background: rgba(26, 92, 255, 0.3);
  color: var(--white);
}

/* ─── FOOTER ─────────────────────────────────────────────────────────── */

footer {
  padding: 40px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--cream);
  border-top: 1px solid var(--border);
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  nav { padding: 12px 20px; }
  .nav-links { gap: 4px; }
  .nav-link { padding: 6px 10px; font-size: 0.82rem; }
  .page { padding: 90px 20px 40px; }
  .form-card { padding: 24px; }
  .form-row { grid-template-columns: 1fr; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .match-card { grid-template-columns: 64px 1fr; gap: 16px; padding: 20px; }
  .score-circle { width: 60px; height: 60px; }
  .score-value { font-size: 1.1rem; }
  .breakdown { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; }
  .btn-lg { width: 100%; }
}

@media (max-width: 480px) {
  .match-card { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .match-meta { justify-content: center; }
  .breakdown { text-align: left; }
  .profile-tags { justify-content: center; }
}
