:root {
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --border: #e5e7eb;
  --err-bg: #fee2e2;
  --err-text: #991b1b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

body { display: flex; flex-direction: column; }

.hdr {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  display: block;
  height: 64px;
  width: auto;
}
.brand-suffix { font-weight: 400; font-size: 14px; }

.profile {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--muted);
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 14px;
}
.btn-link:hover { text-decoration: underline; }

main {
  flex: 1;
  padding: 56px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 420px;
}

.card h1 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
}

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

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
}

.login-card label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

.login-card input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  background: white;
}
.login-card input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 11px 16px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.err {
  background: var(--err-bg);
  color: var(--err-text);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
}

.portals {
  width: 100%;
  max-width: 760px;
}
.portals h1 { margin: 0 0 6px; font-size: 24px; font-weight: 600; }

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

.portal-card {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.portal-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.10);
  transform: translateY(-1px);
}
.portal-card h2 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
}
.portal-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.ftr {
  padding: 18px 24px;
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}
.ftr:empty { display: none; }
