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

:root {
  --primary: #087f8c;
  --primary-dark: #075e67;
  --secondary: #1f7a4d;
  --accent: #d94f3d;
  --bg-start: #102a43;
  --bg-mid: #0f4c5c;
  --bg-end: #0b6e69;
  --card-bg: #ffffff;
  --text: #2d2d2d;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --radius: 20px;
  --shadow: 0 20px 60px rgba(5, 46, 52, 0.35);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  min-height: 100vh;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
}

body {
  background: linear-gradient(135deg, var(--bg-start), var(--bg-mid), var(--bg-end));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

/* ── Card ── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem 2.5rem 2rem;
  width: 100%;
  max-width: 560px;
  animation: fadeSlideUp 0.45s ease both;
}

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

/* ── Logo / Header ── */
.brand-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.brand-strip span {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-strip strong {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: right;
}

.card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.card-header .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.8rem;
  color: #fff;
  background: var(--primary);
  border-radius: 50%;
}

.card-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.35rem;
}

.card-header p {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ── Progress bar ── */
.progress-wrap {
  margin-bottom: 1.8rem;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.45rem;
  font-weight: 600;
}

.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 999px;
  transition: width 0.5s ease;
}

/* ── Section title ── */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.4rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

/* ── Name input ── */
.field-group {
  margin-bottom: 1.6rem;
}

.field-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--text);
}

.field-group input[type="text"] {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
  color: var(--text);
}

.field-group input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(8, 127, 140, 0.15);
}

/* ── Question block ── */
.question-block {
  margin-bottom: 1.6rem;
}

.question-text {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  line-height: 1.45;
  color: var(--text);
}

/* ── Radio chips ── */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip-label {
  cursor: pointer;
}

.chip-label input[type="radio"] {
  display: none;
}

.chip-label span {
  display: inline-block;
  padding: 0.45rem 1rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-light);
  background: #f9fafb;
  transition: all var(--transition);
  user-select: none;
  white-space: nowrap;
}

.chip-label input[type="radio"]:checked + span {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(8, 127, 140, 0.3);
  transform: scale(1.04);
}

.chip-label:hover span {
  border-color: var(--primary);
  color: var(--primary);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  width: 100%;
  margin-top: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 6px 20px rgba(8, 127, 140, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(8, 127, 140, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-finish {
  background: linear-gradient(135deg, var(--secondary), #155e3b);
  color: #fff;
  box-shadow: 0 6px 20px rgba(31, 122, 77, 0.35);
}

.btn-finish:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(31, 122, 77, 0.45);
}

.btn-finish:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* ── Name badge on survey ── */
.name-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(90deg, rgba(8, 127, 140, 0.1), rgba(31, 122, 77, 0.1));
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  border: 1.5px solid rgba(8, 127, 140, 0.25);
  margin-bottom: 1.2rem;
}

/* ── Thanks page ── */
.thanks-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  font-size: 2.6rem;
  font-weight: 900;
  color: #fff;
  background: var(--secondary);
  border-radius: 50%;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.thanks-title {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.thanks-sub {
  text-align: center;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.thanks-detail {
  background: #f9fafb;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  font-size: 0.85rem;
  color: var(--text-light);
  text-align: center;
  border: 1.5px solid var(--border);
}

/* ── Geolocation status ── */
#geo-status {
  font-size: 0.8rem;
  color: var(--text-light);
  text-align: center;
  min-height: 1.2em;
  margin-top: 0.6rem;
  transition: color var(--transition);
}

#geo-status.success { color: #10b981; }
#geo-status.error   { color: #f59e0b; }

/* ── Footer ── */
.footer {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  text-align: center;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .card { padding: 2rem 1.25rem 1.5rem; }
  .brand-strip {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }
  .brand-strip strong { text-align: left; }
  .card-header h1 { font-size: 1.5rem; }
  .chips { gap: 0.4rem; }
}
