/* Portal styles — reuses web-ui design tokens */

/* Reset (subset from web-ui) */
*, *::before, *::after { box-sizing: border-box; }
*:not(dialog) { margin: 0; }
body { line-height: 1.5; -webkit-font-smoothing: antialiased; }
input, button, textarea, select { font: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

/* Variables */
:root {
  --root-font-size: 80%;
  --dstp: 2rem;
  --stp: 1rem;
  --hstp: .5rem;
  --darkgray: hsl(0, 0%, 46%);
}

/* Fonts */
@font-face { font-display: swap; font-family: 'Inter'; font-style: normal; font-weight: 100; src: url('./fonts/inter-v20-latin_latin-ext-100.woff2') format('woff2'); }
@font-face { font-display: swap; font-family: 'Inter'; font-style: normal; font-weight: 400; src: url('./fonts/inter-v20-latin_latin-ext-200.woff2') format('woff2'); }
@font-face { font-display: swap; font-family: 'Inter'; font-style: normal; font-weight: 300; src: url('./fonts/inter-v20-latin_latin-ext-300.woff2') format('woff2'); }
@font-face { font-display: swap; font-family: 'Inter'; font-style: normal; font-weight: 400; src: url('./fonts/inter-v20-latin_latin-ext-regular.woff2') format('woff2'); }
@font-face { font-display: swap; font-family: 'Inter'; font-style: normal; font-weight: 500; src: url('./fonts/inter-v20-latin_latin-ext-500.woff2') format('woff2'); }
@font-face { font-display: swap; font-family: 'Inter'; font-style: normal; font-weight: 600; src: url('./fonts/inter-v20-latin_latin-ext-600.woff2') format('woff2'); }
@font-face { font-display: swap; font-family: 'Inter'; font-style: normal; font-weight: 700; src: url('./fonts/inter-v20-latin_latin-ext-700.woff2') format('woff2'); }
@font-face { font-display: swap; font-family: 'Inter'; font-style: normal; font-weight: 800; src: url('./fonts/inter-v20-latin_latin-ext-800.woff2') format('woff2'); }
@font-face { font-display: swap; font-family: 'Inter'; font-style: normal; font-weight: 900; src: url('./fonts/inter-v20-latin_latin-ext-900.woff2') format('woff2'); }

/* Global */
html {
  font-family: "Inter", sans-serif;
  font-size: var(--root-font-size);
}

body {
  padding: var(--dstp);
}

h1 {
  font-size: 3rem;
  letter-spacing: -1px;
  font-weight: 200;
}

h2, h3 {
  font-weight: 400;
}

h1 span, h2 span, h3 span {
  font-weight: 900;
}

a { color: #2563eb; }
a:hover { color: #1d4ed8; }

/* Tables (from web-ui) */
table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background-color: var(--darkgray);
  color: #fff;
}

th {
  white-space: nowrap;
  text-align: left;
}

th, td {
  padding: 0.75rem;
  border: 1px solid #ddd;
}

tbody tr { transition: background-color 0.3s ease; }
tbody tr:nth-child(even) { background-color: #f9f9f9; }
tbody tr:hover { background-color: #eaeaea; }

/* Score colors (from web-ui) */
.alert { color: #c62828; font-weight: 600; }
.wow { color: #2e7d32; }
td.score-cell.alert { background-color: #f0bfbf; }
td.score-cell.wow { background-color: #c8e6c9; }

.status-pass { color: #15803d; }
.status-fail { color: #dc2626; }
.status-skip { color: #6b7280; }
.status-error { color: #c2410c; }

/* Portal: landing page */
.portal-landing {
  max-width: 540px;
  margin: 4rem auto;
}

.portal-landing .subtitle {
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--darkgray);
  margin-bottom: var(--dstp);
}

.steps {
  display: flex;
  flex-direction: column;
  gap: var(--stp);
}

.step {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: baseline;
  gap: var(--stp);
  border: 1px solid #ddd;
  transition: border-color 0.2s;
}

.step .note {
  font-size: 0.9rem;
  color: var(--darkgray);
  margin-top: var(--hstp);
}

.step:hover { border-color: #999; }

.step-number {
  font-weight: 900;
  font-size: 1.5rem;
  color: #888;
  flex-shrink: 0;
  line-height: 1;
}

.step-text {
  font-weight: 400;
  font-size: 1.1rem;
  line-height: 1.5;
}

.step-text strong { font-weight: 600; }

.step-text code {
  background: #f0f0f0;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Portal: send-password form */
.portal-form {
  max-width: 480px;
  margin: 4rem auto;
}

.portal-form .subtitle {
  font-weight: 400;
  font-size: 1.1rem;
  color: var(--darkgray);
  margin-bottom: var(--dstp);
}

.card {
  border: 1px solid #ddd;
  padding: 1.5rem;
}

label {
  display: block;
  margin-bottom: var(--hstp);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--darkgray);
}

input[type="text"] {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]::placeholder { color: #767676; }
input[type="text"]:focus {
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

button[type="submit"] {
  margin-top: var(--stp);
  padding: 0.7rem 1.8rem;
  background: var(--darkgray);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

button[type="submit"]:hover { background: hsl(0, 0%, 40%); }

.message {
  margin-top: 1.25rem;
  padding: 0.9rem 1rem;
  border-radius: 4px;
  font-size: 0.95rem;
}

.message.success { background: #c8e6c9; color: #2e7d32; }
.message.error { background: #f0bfbf; color: #c62828; }

.back-link {
  display: inline-block;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--darkgray);
  text-decoration: none;
  transition: color 0.2s;
}

.back-link:hover { color: #333; }

.greeting-table {
  margin-top: .9rem;
  width: auto;
  background: #fff;
}

.greeting-table td {
  border: none;
  padding: 0.15rem 0.5rem 0.15rem 0;
  vertical-align: baseline;
  background-color: #fff;
}

.greeting-table td:first-child {
  text-align: right;
}

.greeting-table tr:first-child td {
  font-size: 1.6rem;
}

/* Portal: student results page */
.results-header {
  margin-bottom: var(--dstp);
}

.results-header h1 {
  margin-bottom: 0.25rem;
}

.results-header p {
  color: var(--darkgray);
  font-weight: 400;
}

.results-header .greeting {
  margin-top: .8rem;
  font-size: 1.6rem;
  font-weight: 400;
  color: #000;
}

.results-section {
  margin-bottom: var(--dstp);
}

.results-section h2 {
  margin-bottom: var(--stp);
}

.results-section h3 {
  margin-top: var(--dstp);
  margin-bottom: var(--hstp);
}

footer {
  margin-top: var(--dstp);
  padding-top: var(--stp);
  border-top: 1px solid var(--darkgray);
  color: var(--darkgray);
  font-size: 0.85rem;
}
