
:root {
  --bg: #f3f7f5;
  --surface: #ffffff;
  --surface-soft: #f8fbf9;
  --text: #10231b;
  --muted: #60736a;
  --border: #dce8e2;
  --primary: #17664d;
  --primary-dark: #104c3a;
  --primary-soft: #e8f3ef;
  --danger-bg: #fff4f2;
  --danger-border: #ffcfc7;
  --danger-text: #8a2418;
  --shadow: 0 22px 60px rgba(15, 44, 34, .12);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(23, 102, 77, .18), transparent 34rem),
    radial-gradient(circle at 90% 10%, rgba(23, 102, 77, .10), transparent 30rem),
    linear-gradient(180deg, #f7fbf9 0%, #eef5f1 100%);
}

.page {
  width: 100%;
  min-height: 100vh;
  padding: clamp(16px, 3vw, 48px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.card {
  width: min(100%, 520px);
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(23, 102, 77, .10);
  border-radius: clamp(18px, 2vw, 28px);
  padding: clamp(20px, 2.4vw, 36px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.card.wide {
  width: min(100%, 1120px);
  max-width: none;
}

.login-card {
  margin-top: clamp(8px, 4vh, 56px);
}

.center { text-align: center; }

.bismillah {
  text-align: center;
  font-size: clamp(1.35rem, 2vw, 2rem);
  color: var(--primary);
  margin-bottom: 16px;
  font-weight: 800;
  letter-spacing: .01em;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .03em;
  margin-bottom: 14px;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 2.2vw, 2.25rem);
  line-height: 1.12;
  letter-spacing: -.025em;
}

.muted {
  color: var(--muted);
  margin: 0 0 20px;
  line-height: 1.6;
  font-size: clamp(.95rem, 1vw, 1.06rem);
}

.security-note,
.submission-meta {
  padding: 14px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: #4e6259;
  font-size: .93rem;
  line-height: 1.5;
  margin-bottom: 18px;
}

form {
  margin: 0;
}

label {
  display: block;
  margin: 16px 0 7px;
  font-weight: 750;
}

input[name="aims_id"],
input[name="postcode"] {
  width: 100%;
  padding: 15px 16px;
  border: 1px solid #cbdad3;
  border-radius: 14px;
  font-size: 1.02rem;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(23, 102, 77, .13);
}

button,
.link-button {
  margin-top: 22px;
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  text-align: center;
  text-decoration: none;
  padding: 14px 18px;
  border: 0;
  border-radius: 14px;
  background: var(--primary);
  color: white;
  font-size: 1rem;
  font-weight: 850;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
  box-shadow: 0 10px 24px rgba(23, 102, 77, .20);
}

button:hover,
.link-button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

button:active,
.link-button:active {
  transform: translateY(0);
}

.alert {
  padding: 13px 15px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: 14px;
  color: var(--danger-text);
  margin-bottom: 18px;
  line-height: 1.45;
}

.form-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.question {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: clamp(16px, 1.6vw, 22px);
  margin: 18px 0;
  background: rgba(255,255,255,.98);
  box-shadow: 0 8px 24px rgba(15, 44, 34, .045);
}

.question[hidden] { display: none; }

legend {
  width: 100%;
  font-weight: 850;
  line-height: 1.45;
  padding: 0 4px;
}

.dept {
  display: inline-flex;
  align-items: center;
  margin: 0 6px 6px 0;
  font-size: .76rem;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 4px 9px;
  vertical-align: middle;
}

.question-text {
  display: block;
  margin-top: 8px;
  font-size: clamp(1rem, 1.05vw, 1.12rem);
}

.tooltip {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: .8rem;
  margin-left: 6px;
  cursor: help;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.option {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 15px;
  font-weight: 700;
  background: #fbfdfc;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease, transform .12s ease;
}

.option:hover {
  transform: translateY(-1px);
  border-color: rgba(23, 102, 77, .35);
}

.option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px rgba(23, 102, 77, .08);
}

.option input {
  transform: scale(1.12);
  accent-color: var(--primary);
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.tab-button {
  width: auto;
  min-height: auto;
  margin: 0;
  padding: 10px 14px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid #d6e6de;
  border-radius: 999px;
  box-shadow: none;
}

.tab-button.active {
  background: var(--primary);
  color: #fff;
}

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

.answer-list {
  display: grid;
  gap: 12px;
}

.answer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

.answer-q {
  line-height: 1.5;
  font-weight: 700;
}

.answer-value {
  font-weight: 850;
  color: var(--primary);
  white-space: nowrap;
  background: var(--primary-soft);
  padding: 7px 10px;
  border-radius: 999px;
}

@media (min-width: 1600px) {
  .card.wide {
    width: min(100%, 1380px);
  }

  .options-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .question {
    padding: 26px;
  }
}

@media (max-width: 720px) {
  .page {
    padding: 12px;
  }

  .card {
    padding: 18px;
    border-radius: 18px;
    box-shadow: 0 14px 36px rgba(15, 44, 34, .11);
  }

  .login-card {
    margin-top: 8px;
  }

  .options-grid {
    grid-template-columns: 1fr;
  }

  .question {
    padding: 15px;
    border-radius: 17px;
  }

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

  .answer-value {
    width: fit-content;
    white-space: normal;
  }

  button,
  .link-button {
    min-height: 50px;
  }
}

@media (max-width: 380px) {
  .page { padding: 8px; }
  .card { padding: 15px; }
  .bismillah { font-size: 1.2rem; }
}


.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.bismillah.small {
  text-align: left;
  font-size: clamp(1.05rem, 1.4vw, 1.45rem);
  margin-bottom: 0;
}

.logout-link {
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--primary);
  font-weight: 850;
  background: var(--primary-soft);
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid #d6e6de;
}

.logout-link:hover {
  background: #dceee7;
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
  }

  .logout-link {
    padding: 8px 11px;
    font-size: .9rem;
  }
}
