@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Reset & tokens ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #f5f8ff;
  --surface:      #ffffff;
  --surface-2:    #eef2ff;
  --border:       #dde5f7;
  --border-focus: #3b82f6;

  --blue-50:  #eff6ff;
  --blue-100: #dbeafe;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;

  --text-900: #0f172a;
  --text-600: #475569;
  --text-400: #94a3b8;
  --text-300: #cbd5e1;

  --shadow-sm:  0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md:  0 4px 16px rgba(37,99,235,0.08), 0 1px 4px rgba(15,23,42,0.06);
  --shadow-lg:  0 12px 40px rgba(37,99,235,0.12), 0 4px 12px rgba(15,23,42,0.08);
  --shadow-btn: 0 2px 12px rgba(37,99,235,0.30);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Base ───────────────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-900);
  min-height: 100vh;
  padding: 3rem 1.25rem 6rem;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Ambient orbs ───────────────────────────────────────────────────────────── */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: orb-drift 18s ease-in-out infinite alternate;
}

.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(59,130,246,0.12) 0%, transparent 70%);
  top: -200px; left: -150px;
  animation-duration: 20s;
}

.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(96,165,250,0.10) 0%, transparent 70%);
  top: 40%; right: -180px;
  animation-duration: 25s;
  animation-delay: -8s;
}

.orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(37,99,235,0.07) 0%, transparent 70%);
  bottom: 0; left: 30%;
  animation-duration: 22s;
  animation-delay: -4s;
}

@keyframes orb-drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(30px, 20px) scale(1.05); }
}

/* ── Container ──────────────────────────────────────────────────────────────── */
.container {
  max-width: 780px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
header {
  text-align: center;
  margin-bottom: 3rem;
  animation: fade-up 0.7s var(--ease-out-expo) both;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  color: var(--blue-600);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.badge-pill::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--blue-500);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.7); }
}

header h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-900);
  line-height: 1.1;
  margin-bottom: 0.6rem;
}

header h1 span {
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-700) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-600);
  font-size: 0.95rem;
  font-weight: 400;
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.5;
}

.subtitle-note {
  color: var(--text-400);
  font-size: 0.75rem;
  font-weight: 400;
  margin: 0.4rem auto 0;
  letter-spacing: 0.01em;
}

/* ── Tab bar ────────────────────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 5px;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
  animation: fade-up 0.7s var(--ease-out-expo) 0.1s both;
  position: relative;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 0.6rem 0.5rem;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.tab::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--blue-50);
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.2s;
}

.tab:hover::before { opacity: 1; }

.tab-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-600);
  transition: color 0.2s;
  position: relative;
  z-index: 1;
}

.tab-sub {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-400);
  transition: color 0.2s;
  position: relative;
  z-index: 1;
}

.tab.active {
  background: var(--blue-600);
  box-shadow: var(--shadow-btn);
}

.tab.active::before { opacity: 0; }
.tab.active .tab-label { color: #fff; }
.tab.active .tab-sub  { color: rgba(255,255,255,0.7); }

/* ── Tab panels ─────────────────────────────────────────────────────────────── */
.tab-panel {
  display: none;
  animation: fade-up 0.45s var(--ease-out-expo) both;
}

.tab-panel.active { display: block; }

/* ── Card ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.3s;
}

.card:hover { box-shadow: var(--shadow-lg); }

.card-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.card-icon {
  width: 42px; height: 42px;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-900);
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 0.78rem;
  color: var(--text-400);
  margin-top: 1px;
}

/* ── Form ───────────────────────────────────────────────────────────────────── */
.form-row {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.form-group { margin-bottom: 1.1rem; }
.form-group.grow { flex: 1; min-width: 0; }
.form-group.shrink { flex: 0 0 160px; }

.form-group label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-600);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  color: var(--text-900);
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  appearance: none;
  line-height: 1.5;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-300); }

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
  border-color: var(--blue-400);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--border-focus);
  background: var(--surface);
  box-shadow: 0 0 0 3.5px rgba(59,130,246,0.14);
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  padding-right: 2.2rem;
  cursor: pointer;
}

/* ── Mark button ────────────────────────────────────────────────────────────── */
.mark-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.82rem 1.5rem;
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-700) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.93rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-btn);
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s, opacity 0.2s;
  margin-top: 0.5rem;
  position: relative;
  overflow: hidden;
}

.mark-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.mark-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(37,99,235,0.40);
}

.mark-btn:active {
  transform: translateY(0) scale(0.99);
  box-shadow: var(--shadow-btn);
}

.mark-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-icon {
  font-size: 1rem;
  transition: transform 0.2s var(--ease-spring);
}

.mark-btn:hover .btn-icon { transform: translateX(3px); }

/* ── Loading ────────────────────────────────────────────────────────────────── */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin-top: 2.5rem;
  animation: fade-up 0.4s var(--ease-out-expo) both;
}

.loading.hidden { display: none; }

.loading-inner {
  position: relative;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
}

.pulse-ring {
  position: absolute;
  inset: 0;
  border: 2px solid var(--blue-500);
  border-radius: 50%;
  opacity: 0;
  animation: pulse-ring 2s ease-out infinite;
}

.pulse-ring.delay-1 { animation-delay: 0.6s; }
.pulse-ring.delay-2 { animation-delay: 1.2s; }

@keyframes pulse-ring {
  0%   { transform: scale(0.5); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}

.loading-dot {
  width: 14px; height: 14px;
  background: var(--blue-500);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(59,130,246,0.5);
  animation: dot-pulse 1.4s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(0.75); opacity: 0.6; }
}

.loading-text {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-600);
  letter-spacing: 0.01em;
}

.dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

/* ── Results ────────────────────────────────────────────────────────────────── */
.results {
  margin-top: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  animation: fade-up 0.5s var(--ease-out-expo) both;
}

.results.hidden { display: none; }

.results-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.results-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.results-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-400);
}

.score-badge {
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  padding: 0.3rem 1.1rem;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(37,99,235,0.35);
  letter-spacing: 0.02em;
}

.score-bar-track {
  height: 5px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-400), var(--blue-600));
  border-radius: 999px;
  width: 0%;
  transition: width 1s var(--ease-out-expo);
}

/* ── Feedback content ───────────────────────────────────────────────────────── */
.feedback-content { font-size: 0.91rem; line-height: 1.7; }

.feedback-content h3 {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue-600);
  margin: 1.5rem 0 0.65rem;
}

.feedback-content h3:first-child { margin-top: 0; }

.feedback-content p {
  color: var(--text-600);
  margin-bottom: 0.5rem;
}

.feedback-content ul {
  padding-left: 1.1rem;
  margin-bottom: 0.75rem;
}

.feedback-content li {
  color: var(--text-600);
  margin-bottom: 0.35rem;
}

/* ── Criterion cards ────────────────────────────────────────────────────────── */
.criterion {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  margin-bottom: 0.6rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease-spring);
  cursor: default;
}

.criterion:hover {
  border-color: var(--blue-400);
  box-shadow: 0 4px 16px rgba(59,130,246,0.10);
  transform: translateY(-1px);
}

.criterion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.criterion-name {
  font-weight: 600;
  color: var(--text-900);
  font-size: 0.87rem;
}

.criterion-score {
  font-weight: 700;
  color: var(--blue-600);
  font-size: 0.82rem;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.criterion-bar-track {
  height: 3px;
  background: var(--border);
  border-radius: 999px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.criterion-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-400), var(--blue-600));
  border-radius: 999px;
  transition: width 0.8s var(--ease-out-expo);
}

.criterion-comment {
  color: var(--text-600);
  font-size: 0.84rem;
  line-height: 1.55;
}

/* ── Animations ─────────────────────────────────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  body { padding: 1.5rem 0.85rem 4rem; }
  .card { padding: 1.4rem; }
  .results { padding: 1.4rem; }
  .form-row { flex-direction: column; gap: 0; }
  .form-group.shrink { flex: none; width: 100%; }
  .tab-sub { display: none; }
}

/* ── Toast notification ──────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-900);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  box-shadow: 0 8px 30px rgba(15,23,42,0.2);
  opacity: 0;
  transition: opacity 0.3s var(--ease-out-expo), transform 0.3s var(--ease-out-expo);
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
}

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

/* ── Score badge colour variants ─────────────────────────────────────────────── */
.score-badge.score-high { background: linear-gradient(135deg, #22c55e, #16a34a); }
.score-badge.score-mid  { background: linear-gradient(135deg, #f59e0b, #d97706); }
.score-badge.score-low  { background: linear-gradient(135deg, #ef4444, #dc2626); }

/* ── Criterion bar colour variants ───────────────────────────────────────────── */
.criterion-bar-fill.bar-high { background: linear-gradient(90deg, #4ade80, #22c55e); }
.criterion-bar-fill.bar-mid  { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.criterion-bar-fill.bar-low  { background: linear-gradient(90deg, #f87171, #ef4444); }

/* ── Footer & Disclaimer ─────────────────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 3.5rem;
  padding: 0 1.25rem 2.5rem;
}

.footer-inner {
  max-width: 780px;
  margin: 0 auto;
}

.disclaimer-banner {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  animation: fade-up 0.7s var(--ease-out-expo) 0.3s both;
}

.disclaimer-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.disclaimer-body { flex: 1; }

.disclaimer-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #92400e;
  margin-bottom: 0.4rem;
}

.disclaimer-text {
  font-size: 0.8rem;
  line-height: 1.65;
  color: #78350f;
}

.footer-copy {
  text-align: center;
  font-size: 0.73rem;
  color: var(--text-400);
  letter-spacing: 0.02em;
}

@media (max-width: 560px) {
  .disclaimer-banner { padding: 1rem; gap: 0.75rem; }
  .disclaimer-text { font-size: 0.76rem; }
}
