:root {
  --bg: #ffffff;
  --text: #17201d;
  --muted: #65706c;
  --border: #dddddd;
  --panel: #f8faf9;
  --primary: #085041;
  --primary-hover: #063d32;
  --technical-bg: #e1f5ee;
  --technical-text: #085041;
  --personal-bg: #eeedfe;
  --personal-text: #3c3489;
  --danger: #b42318;
  --danger-hover: #8f1d14;
  --success-bg: #e9f8ef;
  --success-text: #106b39;
  --error-bg: #fcebea;
  --error-text: #9d1c12;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page-shell {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 48px 20px;
}

.form-card,
.admin-login-card {
  width: 100%;
  max-width: 680px;
}

.result-card {
  align-self: center;
}

.page-header {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.1rem;
}

.page-header p:not(.eyebrow),
.detail-header p {
  margin: 10px 0 0;
  color: var(--muted);
}

form {
  display: grid;
  gap: 18px;
}

.field-group {
  display: grid;
  gap: 8px;
}

label {
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  padding: 10px;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(8, 80, 65, 0.12);
}

.was-validated input:invalid,
.was-validated textarea:invalid {
  border-color: var(--danger);
}

.question-section {
  display: grid;
  gap: 18px;
  margin-top: 8px;
}

.section-header {
  border-radius: 6px;
  padding: 12px 14px;
}

.technical-section .section-header {
  background: var(--technical-bg);
  color: var(--technical-text);
}

.personal-section .section-header {
  background: var(--personal-bg);
  color: var(--personal-text);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 10px 16px;
  text-decoration: none;
  transition: background-color 160ms ease, transform 160ms ease;
}

.button:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.primary-button {
  background: var(--primary);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--primary-hover);
}

.secondary-button {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
}

.secondary-button:hover {
  background: var(--panel);
}

.danger-button {
  background: var(--danger);
  color: #ffffff;
}

.danger-button:hover {
  background: var(--danger-hover);
}

.message {
  border-radius: 6px;
  margin-bottom: 18px;
  padding: 14px 16px;
  font-weight: 600;
}

.submit-area {
  display: grid;
  gap: 12px;
}

.submit-area .message {
  margin-bottom: 0;
}

.message-success {
  background: var(--success-bg);
  color: var(--success-text);
}

.message-save-transition {
  animation: save-background-fade 2s ease forwards;
}

@keyframes save-background-fade {
  from {
    background: var(--error-bg);
    color: var(--error-text);
  }

  to {
    background: var(--success-bg);
    color: var(--success-text);
  }
}

.message-error {
  background: var(--error-bg);
  color: var(--error-text);
}

.hidden {
  display: none;
}

.admin-login-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 20px;
}

.admin-login-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
}

.admin-login-card h1 {
  margin-bottom: 22px;
}

.admin-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0;
}

.admin-header,
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.bulk-actions-counts {
  display: flex;
  gap: 16px;
}

.viewer-link-panel {
  margin-bottom: 16px;
}

.viewer-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.viewer-link-row form {
  margin: 0;
}

.viewer-link-input {
  flex: 1;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.applicant-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.applicant-table th,
.applicant-table td {
  padding: 13px 14px;
  text-align: left;
}

.applicant-table th {
  background: var(--panel);
  font-size: 0.86rem;
  text-transform: uppercase;
}

.applicant-table tbody tr:nth-child(even) {
  background: #fbfcfc;
}

.applicant-table tbody tr + tr {
  border-top: 1px solid var(--border);
}

.select-column {
  width: 68px;
}

.select-column span {
  display: block;
  margin-bottom: 6px;
}

.select-column input {
  width: auto;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 10px;
}

.status-ny {
  background: #eceff1;
  color: #46515a;
}

.status-optag {
  background: #dff6e7;
  color: #166534;
}

.status-graazone {
  background: #fff1d6;
  color: #9a5b00;
}

.status-afslag {
  background: #fde2df;
  color: #a32016;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 4px 10px;
}

.score-1,
.score-2 {
  background: #fde2df;
  color: #a32016;
}

.score-3 {
  background: #fff1d6;
  color: #9a5b00;
}

.score-4,
.score-5 {
  background: #dff6e7;
  color: #166534;
}

.detail-shell {
  max-width: 880px;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
}

.answers-list {
  display: grid;
  gap: 16px;
}

.answer-block {
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.answer-block h2 {
  margin-bottom: 8px;
}

.answer-block p {
  margin: 0;
  white-space: normal;
}

.admin-edit-panel {
  margin-top: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.admin-delete-panel {
  margin-top: 18px;
  border: 1px solid #f4b7b0;
  border-radius: 8px;
  background: #fffafa;
  padding: 20px;
}

.admin-edit-panel h2,
.admin-delete-panel h2 {
  margin-bottom: 18px;
}

.admin-delete-panel p {
  color: var(--muted);
  margin: 0 0 16px;
}

@media (max-width: 720px) {
  .page-shell,
  .admin-shell {
    padding-top: 28px;
    padding-bottom: 28px;
  }

  h1 {
    font-size: 1.55rem;
  }

  .admin-header,
  .detail-header {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-actions,
  .admin-actions .button {
    width: 100%;
  }

  .admin-login-card,
  .admin-edit-panel,
  .admin-delete-panel {
    padding: 18px;
  }
}
