@font-face {
  font-family: Montserrat;
  src: url('/assets/fonts/Montserrat-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Montserrat;
  src: url('/assets/fonts/Montserrat-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --background: #f3f6f8;
  --foreground: #17212b;
  --card: #fff;
  --primary: #0f3446;
  --secondary: #edf2f5;
  --muted-foreground: #647282;
  --accent: #e4edf3;
  --border: #d9e2e8;
  --ring: #347fb6;
}

* { box-sizing: border-box; }
html { min-height: 100%; color-scheme: light; background: var(--background); }
body { margin: 0; min-height: 100vh; color: var(--foreground); font: 600 14px/1.5 Montserrat, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; text-rendering: optimizeLegibility; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, strong { font-weight: 700; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a, input[type='checkbox'] { -webkit-tap-highlight-color: transparent; }
button, input[type='checkbox'] { cursor: pointer; }
button { padding: 0; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible, a:focus-visible, input[type='checkbox']:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
[hidden] { display: none !important; }
::selection { background: rgba(52, 127, 182, .22); color: #0f3446; }
.icon { display: block; width: 18px; height: 18px; flex-shrink: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 8px 15px; border: 1px solid transparent; border-radius: 3px; color: white; background: #347fb6; font-size: 13px; font-weight: 700; line-height: 20px; text-align: center; transition: background-color .15s; }
.button:hover { background: #2e73a6; }
.button-secondary { border-color: #cbd5df; color: #17212b; background: white; }
.button-secondary:hover { background: #edf2f5; }
.button .icon { width: 16px; height: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.login-main { position: relative; display: flex; min-height: 100vh; align-items: center; justify-content: center; overflow: hidden; padding: 40px 16px; background: #eef3f7; color: #020617; }
.login-main::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 18%, rgba(0, 54, 74, .1), transparent 34rem); }
.login-card { position: relative; z-index: 1; width: 100%; max-width: 450px; padding: 24px; border-radius: 3px; background: white; box-shadow: 0 16px 40px rgba(0, 0, 0, .22); }
.login-brand { margin-bottom: 20px; text-align: center; }
.login-logo { display: block; width: 220px; max-width: 100%; height: auto; margin: 0 auto 8px; object-fit: contain; }
.login-brand h1 { color: #020617; font-size: 18px; line-height: 28px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-field label { color: #020617; font-size: 14px; line-height: 20px; }
.login-input { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 34px; padding: 0 12px; border: 1px solid #cbd5e1; border-radius: 2px; color: #0f172a; background: white; font-size: 14px; font-weight: 600; outline: none; box-shadow: none; }
.login-input::placeholder { color: #64748b; opacity: 1; }
.login-input:hover, .login-input:focus, .login-input:active { border-color: #cbd5e1; outline: none; box-shadow: none; }
.login-input:focus-visible { outline: 2px solid rgba(52, 127, 182, .65); outline-offset: 1px; }
.login-input:-webkit-autofill, .login-input:-webkit-autofill:hover, .login-input:-webkit-autofill:focus { -webkit-text-fill-color: #0f172a; border-color: #cbd5e1; box-shadow: 0 0 0 1000px white inset; caret-color: #0f172a; transition: background-color 999999s ease-in-out 0s; }
.password-field { position: relative; }
.password-field input { padding-right: 40px; }
.password-toggle { position: absolute; top: 0; right: 0; bottom: 0; display: grid; width: 40px; place-items: center; border: 0; border-radius: 2px; color: #475569; background: transparent; }
.password-toggle:hover { color: #020617; }
.password-toggle .icon { width: 16px; height: 16px; }
.remember-field { display: flex; width: fit-content; align-items: center; gap: 8px; color: #020617; font-size: 14px; line-height: 20px; cursor: pointer; }
.remember-field input { width: 15px; height: 15px; margin: 0; border-radius: 2px; accent-color: #347fb6; }
.login-submit { width: 100%; height: 36px; margin-top: 4px; padding-top: 0; padding-bottom: 0; font-size: 14px; }
.login-footer { position: absolute; right: 0; bottom: 20px; left: 0; z-index: 1; display: flex; justify-content: center; padding: 0 16px; color: #475569; font-size: 14px; font-weight: 700; text-align: center; }
.form-error { margin-bottom: 16px; padding: 10px 12px; border: 1px solid #f1b8be; border-radius: 3px; background: #fff3f4; color: #a32134; font-size: 12px; line-height: 19px; overflow-wrap: anywhere; }
.form-error strong { display: block; margin-bottom: 2px; }
.mfa-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--primary); }
.mfa-heading h2 { font-size: 14px; }
.form-description { margin-bottom: 16px; color: #475569; font-size: 13px; line-height: 21px; }
.code-input { letter-spacing: .08em; }
.mfa-help { margin-top: 18px; color: #647282; font-size: 12px; line-height: 20px; }
.mfa-help a { display: inline-flex; align-items: center; gap: 2px; color: #1c65b0; }
.mfa-help .icon { width: 13px; height: 13px; }
.mfa-help a:hover, .back-link:hover { text-decoration: underline; }
.back-link { display: inline-block; margin-top: 12px; padding: 0; border: 0; background: transparent; color: #1c65b0; font-size: 12px; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 16px; padding: 12px; border: 1px solid var(--border); border-radius: 3px; background: #f3f6f8; list-style: none; }
.recovery-codes li { min-width: 0; padding: 3px 0; text-align: center; }
.recovery-codes code { font: inherit; font-size: 12px; letter-spacing: .04em; overflow-wrap: anywhere; }

.portal-page { display: flex; flex-direction: column; background: radial-gradient(circle at 80% 0%, rgba(0, 54, 74, .07), transparent 28rem), var(--background); }
.skip-link { position: fixed; top: 8px; left: 16px; z-index: 5; padding: 8px 12px; transform: translateY(-150%); border-radius: 3px; color: white; background: var(--primary); }
.skip-link:focus { transform: translateY(0); }
.portal-header { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 20px; padding: 7px 24px; border-bottom: 1px solid #d8dde2; background: white; }
.portal-brand { display: flex; flex-shrink: 0; align-items: center; gap: 16px; }
.portal-brand img { display: block; width: 112px; height: auto; }
.portal-brand > span { padding-left: 16px; border-left: 1px solid #d8dde2; color: #0f3446; font-size: 14px; font-weight: 700; }
.header-account { display: flex; min-width: 0; align-items: center; gap: 10px; }
.avatar { display: grid; width: 30px; height: 30px; flex-shrink: 0; place-items: center; border-radius: 50%; background: #dbe3ea; color: #334155; font-size: 11px; font-weight: 700; }
.user-details { min-width: 0; padding-right: 12px; }
.user-name { display: block; max-width: 220px; overflow: hidden; color: #0f172a; font-size: 12px; font-weight: 700; line-height: 17px; text-overflow: ellipsis; white-space: nowrap; }
.user-email { display: block; max-width: 220px; overflow: hidden; color: #64748b; font-size: 11px; line-height: 15px; text-overflow: ellipsis; white-space: nowrap; }
.logout-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 32px; padding: 4px 10px; border: 1px solid #d8dde2; border-radius: 3px; color: #334155; background: white; font-size: 12px; white-space: nowrap; }
.logout-button:hover { background: #eef6fb; color: #006fa3; }
.logout-button .icon { width: 15px; height: 15px; }
.portal-content { width: 100%; max-width: 1104px; flex: 1; align-self: center; padding: 32px 32px 52px; }
.page-heading { margin-bottom: 28px; }
.page-heading h1 { color: #0f172a; font-size: 24px; line-height: 32px; }
.page-heading p { margin-top: 5px; color: #647282; font-size: 13px; }
.portal-section + .portal-section { margin-top: 32px; }
.section-title { margin-bottom: 12px; color: #0f3446; font-size: 16px; line-height: 24px; }
.portal-card { overflow: hidden; padding: 24px; border: 1px solid #d8dde2; border-radius: 3px; background: white; box-shadow: 0 1px 2px rgba(15, 23, 42, .025); }
.card-heading { display: flex; align-items: center; gap: 14px; }
.card-icon { display: grid; width: 42px; height: 42px; flex-shrink: 0; place-items: center; border: 1px solid #d9e2e8; border-radius: 3px; background: #edf2f5; color: #0f3446; }
.card-icon .icon { width: 22px; height: 22px; }
.card-heading h3 { color: #0f172a; font-size: 16px; line-height: 24px; }
.card-subtitle { margin-top: 2px; color: #647282; font-size: 12px; line-height: 19px; }
.card-description { margin-top: 18px; color: #475569; font-size: 13px; line-height: 22px; }
.card-bottom { display: flex; align-items: center; justify-content: flex-start; gap: 16px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #e6ebef; }
.download-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: #647282; font-size: 12px; line-height: 20px; }
.card-note { color: #647282; font-size: 12px; line-height: 20px; }
.download-unavailable { color: #647282; font-size: 12px; }
.portal-footer { display: flex; min-height: 30px; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; padding: 5px 16px; border-top: 1px solid #d8dde2; background: white; color: #475569; font-size: 11px; line-height: 19px; }
.portal-footer a { color: #1c65b0; }
.portal-footer a:hover { text-decoration: underline; }

@media (min-width: 640px) { .login-card { padding-right: 28px; padding-left: 28px; } }
@media (max-width: 700px) {
  .portal-header { gap: 12px; padding-right: 16px; padding-left: 16px; }
  .user-details { display: none; }
  .portal-content { padding: 26px 20px 40px; }
  .portal-card { padding: 20px; }
  .card-bottom { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 440px) {
  .portal-header { gap: 8px; }
  .portal-brand { gap: 10px; }
  .portal-brand img { width: 88px; }
  .portal-brand > span { padding-left: 10px; font-size: 12px; }
  .header-account { gap: 8px; }
  .avatar { display: none; }
  .logout-button { padding-right: 7px; padding-left: 7px; }
  .logout-button .icon { display: none; }
  .portal-content { padding-right: 16px; padding-left: 16px; }
  .portal-card { padding: 18px; }
  .card-bottom .button { width: 100%; font-size: 12px; }
  .card-heading { gap: 11px; }
  .card-heading h3 { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
