:root {
  --green: #3f7a4e;
  --green-tint: #e4f2e6;
  --red: #b83b3b;
  --red-tint: #fbe6e6;
  --blue: #35578f;
  --blue-tint: #e3ebf7;
  --yellow: #c1861a;
  --yellow-tint: #fbf0dc;
  --ink: #241f1a;
  --paper: #faf6ee;
  --paper-card: #ffffff;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 2px 2px 0 var(--ink);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 3px solid var(--ink);
  background: var(--paper);
}

.brand {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.lang-switch a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border: 2px solid var(--ink);
  border-radius: 6px;
  margin-left: 0.25rem;
}

.lang-switch a:hover { background: var(--ink); color: var(--paper); }

.header-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

.nav-link:hover { text-decoration: underline; }

.nav-link-strong {
  background: var(--ink);
  color: var(--paper);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
}

.nav-link-strong:hover { text-decoration: none; opacity: 0.85; }

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ---------------- Hero ---------------- */
.hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
  background:
    radial-gradient(circle at 15% 20%, var(--green-tint) 0%, transparent 40%),
    radial-gradient(circle at 85% 15%, var(--red-tint) 0%, transparent 40%),
    radial-gradient(circle at 20% 85%, var(--blue-tint) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, var(--yellow-tint) 0%, transparent 40%);
  border-radius: 20px;
}

.hero-badge {
  display: inline-block;
  background: var(--paper-card);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(1.9rem, 4.5vw, 3.1rem);
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
  text-transform: uppercase;
}

.hero-em { color: var(--red); }

.hero-sub {
  font-size: 1.15rem;
  max-width: 34rem;
  margin: 0 auto 2rem;
  opacity: 0.85;
}

.cta-button {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  padding: 0.9rem 2.2rem;
  border-radius: 10px;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.1s ease;
}

.cta-button:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.cta-button:active { transform: translate(0, 0); box-shadow: var(--shadow-sm); }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0.75;
}

/* ---------------- Meet the types ---------------- */
.meet-section {
  text-align: center;
  padding: 4rem 0 1rem;
}

.section-title {
  font-size: 1.9rem;
  font-weight: 900;
  margin: 0 0 0.4rem;
}

.section-sub {
  opacity: 0.75;
  margin: 0 0 2.5rem;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  text-align: left;
}

@media (max-width: 700px) {
  .color-grid { grid-template-columns: 1fr; }
}

.color-card {
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  background: var(--paper-card);
}

.color-card-title {
  font-size: 1.3rem;
  font-weight: 900;
  text-transform: uppercase;
  margin: 0 0 0.35rem;
}

.color-card-blurb {
  margin: 0 0 1.1rem;
  opacity: 0.8;
}

.color-card-members {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.member-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.3rem 0.7rem 0.3rem 0.4rem;
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--paper);
}

.member-emoji { font-size: 1.1rem; }

.color-green { background: var(--green-tint); }
.color-green .color-card-title { color: var(--green); }
.color-red { background: var(--red-tint); }
.color-red .color-card-title { color: var(--red); }
.color-blue { background: var(--blue-tint); }
.color-blue .color-card-title { color: var(--blue); }
.color-yellow { background: var(--yellow-tint); }
.color-yellow .color-card-title { color: var(--yellow); }

/* ---------------- Bottom CTA ---------------- */
.bottom-cta {
  text-align: center;
  padding: 4rem 1rem 1rem;
}

.bottom-cta p {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.status-note {
  margin-top: 2rem;
  color: var(--green);
  font-weight: 600;
  text-align: center;
}

/* ---------------- Survey ---------------- */
#survey-root h1 {
  font-size: 1.7rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 0.5rem;
}

.progress-bar-track {
  height: 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-card);
  overflow: hidden;
  margin: 0 0 2rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--blue), var(--yellow), var(--red));
  width: 0%;
  transition: width 0.25s ease;
}

.question {
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
  margin-bottom: 1rem;
  background: var(--paper-card);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.question:has(.opt.selected) {
  box-shadow: var(--shadow-sm);
}

.q-prompt {
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.q-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.opt {
  display: inline-block;
  text-align: left;
  padding: 0.65rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.1s ease, transform 0.1s ease;
}

.opt:hover {
  background: #f0ead9;
  transform: translateY(-1px);
}

.opt.selected {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.opt.submit {
  align-self: center;
  font-weight: 800;
  padding: 0.85rem 2.5rem;
  font-size: 1.05rem;
  box-shadow: var(--shadow);
}

.opt.submit:not(:disabled):hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

.opt.submit:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.survey-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-bottom: 2rem;
}

#progress {
  font-weight: 700;
  opacity: 0.7;
  font-size: 0.9rem;
}

/* ---------------- Result ---------------- */
.result {
  text-align: center;
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 3rem 1.75rem;
  background: var(--paper-card);
  box-shadow: var(--shadow);
  animation: pop-in 0.3s ease;
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.result-emoji {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.result-group {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  margin: 0 0 0.25rem;
}

.result h1 {
  font-size: 2.2rem;
  font-weight: 900;
  margin: 0.1rem 0;
}

.result-code {
  font-weight: 700;
  opacity: 0.7;
  margin-top: 0;
  font-size: 0.9rem;
}

.result-tagline {
  font-style: italic;
  font-size: 1.1rem;
  margin: 1.25rem 0 0.75rem;
}

.result-desc {
  max-width: 32rem;
  margin: 0 auto 2rem;
  opacity: 0.85;
  line-height: 1.5;
}

.result.color-green { border-color: var(--green); background: linear-gradient(180deg, var(--green-tint), var(--paper-card) 40%); }
.result.color-green .result-group { color: var(--green); }
.result.color-red { border-color: var(--red); background: linear-gradient(180deg, var(--red-tint), var(--paper-card) 40%); }
.result.color-red .result-group { color: var(--red); }
.result.color-blue { border-color: var(--blue); background: linear-gradient(180deg, var(--blue-tint), var(--paper-card) 40%); }
.result.color-blue .result-group { color: var(--blue); }
.result.color-yellow { border-color: var(--yellow); background: linear-gradient(180deg, var(--yellow-tint), var(--paper-card) 40%); }
.result.color-yellow .result-group { color: var(--yellow); }

.result-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ---------------- Auth ---------------- */
.auth-card {
  max-width: 26rem;
  margin: 3rem auto;
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 2.5rem;
  background: var(--paper-card);
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-size: 1.6rem;
  font-weight: 900;
  margin: 0 0 1.5rem;
  text-align: center;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-card label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.auth-card input {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.6rem 0.75rem;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}

.auth-card input:focus {
  outline: none;
  box-shadow: var(--shadow-sm);
}

.auth-card .opt.submit {
  margin-top: 0.5rem;
  width: 100%;
  text-align: center;
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

.auth-switch a {
  color: var(--ink);
  font-weight: 700;
}

.form-error {
  background: var(--red-tint);
  border: 2px solid var(--red);
  color: var(--red);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.account-greeting { font-size: 1.05rem; }

.admin-badge {
  display: inline-block;
  background: var(--yellow-tint);
  border: 2px solid var(--yellow);
  color: var(--yellow);
  font-weight: 800;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

/* ---------------- Admin ---------------- */
.admin-table-wrap {
  overflow-x: auto;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--paper-card);
  margin-top: 1.5rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th, .admin-table td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--paper);
  white-space: normal;
  vertical-align: top;
}

.admin-table td { max-width: 18rem; }

.admin-table th {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  background: var(--paper);
}

.admin-table tr:last-child td { border-bottom: none; }

.admin-actions {
  display: flex;
  gap: 0.5rem;
}

.admin-actions form { display: inline; }
.admin-actions .opt { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

.admin-color-dot {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--ink);
}
.color-dot-green { background: var(--green); }
.color-dot-red { background: var(--red); }
.color-dot-blue { background: var(--blue); }
.color-dot-yellow { background: var(--yellow); }

.admin-tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.admin-tab {
  padding: 0.5rem 1.2rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
}

.admin-tab.active {
  background: var(--ink);
  color: var(--paper);
}

.admin-filter-form {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.admin-filter-form input, .admin-filter-form select {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}

.admin-table details summary { cursor: pointer; list-style: none; }
.admin-table details summary::-webkit-details-marker { display: none; }

.admin-edit-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 20rem;
  white-space: normal;
  padding: 0.75rem 0;
}

.admin-edit-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-weight: 700;
  font-size: 0.8rem;
}

.admin-edit-form input, .admin-edit-form textarea {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.5rem 0.65rem;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
}
