:root {
  --ink: var(--iw-ink);
  --muted: var(--iw-muted);
  --line: var(--iw-line);
  --bg: var(--iw-paper);
  --card: var(--iw-surface);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--bg);
  font: 16px/1.6 var(--iw-font);
}
a { color: var(--iw-accent-hover); }
:focus-visible { outline: 2px solid var(--iw-accent-hover); outline-offset: 3px; }

.site-account { display: flex; align-items: center; gap: 12px; margin-left: auto; min-width: 0; }
.site-account form { margin: 0; }
.site-user { color: var(--muted); overflow-wrap: anywhere; }
.site-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 0;
  background: none;
  padding: 0 2px;
  color: var(--ink);
  font: inherit;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.site-link:hover { color: var(--iw-accent-hover); }

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 24px clamp(18px, 5vw, 64px);
  color: var(--muted);
  font-size: 13px;
}

/* portal */

.portal { width: min(1080px, 100%); margin: 0 auto; padding: 24px clamp(18px, 5vw, 40px) 40px; }
.portal-hero { padding: 36px 0 34px; }
.portal-hero h1 { margin: 0; font-size: clamp(32px, 5vw, 52px); line-height: 1.2; letter-spacing: -0.01em; }
.portal-hero p { max-width: 560px; margin: 16px 0 0; color: var(--muted); font-size: 18px; }

/* account */

.auth { flex: 1; display: grid; place-items: start center; padding: clamp(24px, 5vw, 56px) 18px; }
.auth-card {
  width: min(460px, 100%);
  padding: clamp(18px, 4vw, 32px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.auth-card h1 { margin: 0 0 18px; font: 700 clamp(23px, 4vw, 29px)/1.3 var(--iw-display); }
.auth-sub { margin: 0 0 20px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.auth-form { display: grid; gap: 16px; }
.auth-form label, .auth-field { display: grid; gap: 6px; }
.auth-form label { font-weight: 600; font-size: 14px; }
.auth-form input:not([type="hidden"]) {
  width: 100%;
  padding: 11px 14px;
  min-height: 44px;
  border: 1px solid var(--iw-control-line);
  border-radius: var(--iw-radius);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
}
.auth-form input:focus { border-color: var(--iw-accent-hover); }
.auth-form input[aria-invalid='true'] { border-color: var(--iw-accent-hover); }
.auth-form .helptext, .auth-form ul:not(.errorlist) { color: var(--muted); font-size: 12px; font-weight: 400; }
.auth-form ul { margin: 0; padding-left: 18px; }
.errorlist { color: #b42318; font-size: 13px; font-weight: 400; }
.auth-error { padding: 10px 12px; border-radius: 10px; background: #fdecea; color: #b42318; font-size: 14px; }
.auth-error .errorlist { padding-left: 0; list-style: none; }
.auth-form button { margin-top: 4px; cursor: pointer; }
@media (prefers-reduced-motion: no-preference) {
  .auth-form input:not([type="hidden"]) { transition: border-color 150ms ease-out; }
  .auth-form button { transition: background-color 150ms ease-out, transform 150ms ease-out; }
  .auth-form button:active { transform: translateY(1px); }
}
.auth-alt { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 520px) {
  .iw-header > .iw-nav { order: 1; width: 100%; margin-left: -10px; }
}
