:root {
  --accent: #1f3a5f;
  --accent-light: #2f5788;
  --bg: #f5f6f8;
  --card-bg: #ffffff;
  --border: #e0e2e7;
  --text: #202430;
  --muted: #6b7280;
  --error: #b91c1c;
  --ok: #15803d;
}

* { box-sizing: border-box; }

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

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

header h1 {
  margin: 0 0 4px;
  font-size: 28px;
  color: var(--accent);
}

.subtitle {
  color: var(--muted);
  margin: 0 0 28px;
}

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

.card h2 {
  margin-top: 0;
  font-size: 17px;
  color: var(--accent);
}

.card h3 {
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 6px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: -6px;
}

textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  margin: 8px 0 12px;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
}

.file-btn {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.file-btn:hover { background: #eef2f7; }

.filename {
  color: var(--muted);
  font-size: 13px;
}

.or-divider {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 10px 0 4px;
}

button.primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 7px;
  font-size: 14px;
  cursor: pointer;
}

button.primary:hover { background: var(--accent-light); }
button.primary:disabled { opacity: 0.5; cursor: not-allowed; }

.status {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.status.ok { color: var(--ok); }

.error {
  display: inline-block;
  color: var(--error);
  font-size: 13px;
  margin-left: 10px;
}

.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.loading.hidden, .hidden { display: none !important; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.downloads {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.download-btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 7px;
  font-size: 14px;
}

.download-btn:hover { background: var(--accent-light); }

.preview-box {
  white-space: pre-wrap;
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 20px;
}

#match-notes {
  font-size: 13.5px;
  color: var(--muted);
  padding-left: 20px;
}

.optional {
  font-weight: normal;
  font-size: 0.8em;
  color: #888;
}

/* Evals & Awards (supporting documents) */
.doc-list {
  margin-top: 14px;
}
.doc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fafbfc;
}
.doc-label {
  flex: 1;
  font-size: 13.5px;
  color: var(--accent);
  font-weight: 600;
  word-break: break-word;
}
.doc-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.doc-delete {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12.5px;
  cursor: pointer;
}
.doc-delete:hover { background: #f3d6d6; color: #a12; border-color: #e6b8b8; }
.doc-delete:disabled { opacity: 0.5; cursor: default; }

.auth-page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 420px);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.auth-card h1 {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 26px;
}

.auth-intro,
.auth-links,
.form-message {
  color: var(--muted);
  line-height: 1.5;
}

.auth-field {
  margin: 18px 0;
}

.auth-field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.auth-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}

.form-message {
  min-height: 1.5em;
  margin: 14px 0 0;
}

.noscript-message {
  margin: 16px;
  color: var(--error);
  font-weight: 600;
}

.account-page,
.profile-page {
  width: min(100%, 900px);
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.account-header {
  margin-bottom: 24px;
}

.account-header h1 {
  margin: 0 0 8px;
  color: var(--accent);
}

.account-header p {
  color: var(--muted);
  margin: 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.dashboard-card,
.profile-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.dashboard-card h2,
.profile-section h2 {
  color: var(--accent);
  font-size: 18px;
  margin-top: 0;
}

.dashboard-card-disabled {
  color: var(--muted);
}

.primary-link {
  display: inline-block;
  background: var(--accent);
  border-radius: 7px;
  color: white;
  padding: 10px 18px;
  text-decoration: none;
}

.primary-link:hover { background: var(--accent-light); }

.profile-section {
  margin-bottom: 20px;
}

.profile-field {
  margin: 16px 0;
}

.profile-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.profile-field input,
.profile-field textarea {
  width: 100%;
}

.profile-checkbox {
  align-items: center;
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

.profile-actions {
  align-items: center;
  display: flex;
  gap: 18px;
}

button.secondary {
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 7px;
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
  padding: 10px 18px;
}

.site-nav {
  align-items: center;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 18px;
  padding: 12px 24px;
}

.site-brand {
  color: var(--accent);
  font-weight: 700;
  margin-right: auto;
  text-decoration: none;
}

.auth-tagline {
  color: var(--accent);
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 16px;
}
