:root {
  --navy: #323c5a;
  --navy-dark: #262e46;
  --teal: #00b3aa;
  --teal-dark: #009991;
  --gold: #e6aa28;
  --red: #dc5a64;
  --cream: #faf8f3;
  --border: #e4e6ec;
  --text: #1f2430;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--cream);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ---- Top navigation ---- */

.topbar {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  border-bottom: 3px solid var(--gold);
  color: white;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar a { color: white; text-decoration: none; }

.topbar .brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 9px;
}
.topbar .brand img { height: 26px; width: auto; display: block; }

.topbar nav { display: flex; gap: 4px; align-items: center; }
.topbar nav a {
  opacity: 0.78;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  transition: opacity 0.15s, background 0.15s;
}
.topbar nav a:hover { opacity: 1; background: rgba(255,255,255,0.08); }
.topbar nav a.active { opacity: 1; background: rgba(255,255,255,0.12); }
.topbar nav .divider { width: 1px; height: 20px; background: rgba(255,255,255,0.2); margin: 0 6px; }
.topbar nav .user-name { opacity: 0.7; font-size: 0.85rem; margin-right: 4px; }

.topbar button.logout {
  background: transparent; border: 1px solid rgba(255,255,255,0.35);
  color: white; padding: 7px 14px; border-radius: 6px; cursor: pointer;
  font-size: 0.85rem; font-weight: 600; transition: background 0.15s;
}
.topbar button.logout:hover { background: rgba(255,255,255,0.1); }

/* ---- Layout ---- */

.container { max-width: 980px; margin: 0 auto; padding: 36px 20px 60px; }

.card {
  background: white; border: 1px solid var(--border); border-radius: 12px;
  padding: 26px; margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(20, 24, 40, 0.03);
}

h1 {
  color: var(--navy); font-size: 1.7rem; font-family: Georgia, "Times New Roman", serif;
  margin-bottom: 6px;
}
h2 {
  color: var(--navy); font-size: 1.05rem; font-family: Georgia, "Times New Roman", serif;
  margin-bottom: 4px;
}

/* ---- Forms ---- */

input, textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 0.92rem; margin-bottom: 10px; font-family: inherit;
  background: #fff; color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 179, 170, 0.12);
}

label { font-weight: 600; font-size: 0.82rem; color: #5b6072; display: block; margin-bottom: 4px; letter-spacing: 0.01em; }

button {
  background: var(--teal); color: white; border: none; padding: 10px 18px;
  border-radius: 7px; cursor: pointer; font-size: 0.9rem; font-weight: 600;
  transition: background 0.15s, transform 0.1s;
}
button:hover { background: var(--teal-dark); }
button:active { transform: translateY(1px); }
button.secondary { background: var(--navy); }
button.secondary:hover { background: var(--navy-dark); }
button.danger { background: var(--red); }
button.danger:hover { background: #c94955; }
button.gold { background: var(--gold); color: var(--navy); }
button.gold:hover { background: #d69a1f; }

/* ---- Tables ---- */

table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
th { color: var(--navy); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }

.pill {
  display: inline-block; background: #eef1f7; color: var(--navy);
  padding: 3px 11px; border-radius: 20px; font-size: 0.75rem; margin-right: 4px;
  font-weight: 600;
}

.msg { padding: 11px 15px; border-radius: 8px; margin-bottom: 14px; font-size: 0.88rem; font-weight: 500; }
.msg.error { background: #fdeceb; color: var(--red); border: 1px solid #f3c3c8; }
.msg.success { background: #e7f8f0; color: #1a7f52; border: 1px solid #b9ecd9; }

.question-block {
  border: 1px solid var(--border); border-radius: 9px; padding: 16px; margin-bottom: 12px; background: #fbfbfc;
}

.login-wrap {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: radial-gradient(circle at 30% 20%, #3d4874 0%, var(--navy-dark) 60%);
}
.login-card {
  width: 380px; box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  border: none;
}

.flex { display: flex; gap: 10px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.muted { color: #8a8f9e; font-size: 0.84rem; }

.survey-brand-header {
  text-align: center;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--gold), var(--teal)) 1;
}
.survey-brand-header img { max-width: 220px; width: 100%; height: auto; }
.results-logo { height: 34px; width: auto; }
