:root {
  --portal-navy: #0d3157;
  --portal-blue: #1265c8;
  --portal-cyan: #13b8ca;
  --portal-green: #0f9f74;
  --portal-bg: #f3f7fb;
  --portal-border: #d8e3ef;
  --portal-text: #15314d;
  --portal-muted: #667d93;
  --portal-shadow: 0 16px 40px rgba(22, 56, 91, .12);
}

* { box-sizing: border-box; }
body.portal-page {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #edf5fb 0, #f8fbfd 42%, #eef5f9 100%);
  color: var(--portal-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.portal-shell { min-height: 100vh; display: flex; flex-direction: column; }
.portal-topbar {
  background: linear-gradient(115deg, #082d54, #0d58a7 64%, #0c77b9);
  color: #fff;
  border-bottom: 4px solid var(--portal-cyan);
  box-shadow: 0 8px 24px rgba(13, 49, 87, .15);
}
.portal-topbar-inner {
  width: min(1320px, calc(100% - 32px));
  min-height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.portal-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.portal-brand img { width: 54px; height: 54px; border-radius: 15px; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.portal-brand h1 { margin: 0; font-size: clamp(1rem, 2vw, 1.3rem); line-height: 1.2; }
.portal-brand p { margin: 4px 0 0; font-size: .82rem; opacity: .84; }
.portal-brand--portal-identity { flex: 1 1 auto; min-width: 0; gap: 14px; }
.portal-brand--portal-identity .portal-symbol {
  display: block;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.portal-brand-copy { min-width: 0; }
.portal-brand-copy h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-user { display: flex; align-items: center; gap: 12px; font-size: .86rem; }
.portal-user-meta { text-align: right; }
.portal-user-meta strong { display: block; }
.portal-user-meta span { opacity: .82; text-transform: capitalize; }
.portal-button {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.portal-button:hover { transform: translateY(-1px); }
.portal-button.primary { background: linear-gradient(135deg, var(--portal-blue), #1876de); color: #fff; box-shadow: 0 9px 20px rgba(18, 101, 200, .2); }
.portal-button.secondary { background: #fff; color: var(--portal-navy); border: 1px solid var(--portal-border); }
.portal-button.ghost { color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); }
.portal-button.danger { background: #fff1f1; color: #a42d37; border: 1px solid #ffd3d6; }

.portal-main { width: min(1320px, calc(100% - 32px)); margin: 30px auto 48px; flex: 1; }
.portal-hero {
  background: #fff;
  border: 1px solid var(--portal-border);
  border-radius: 22px;
  box-shadow: var(--portal-shadow);
  padding: clamp(24px, 4vw, 42px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  position: relative;
}
.portal-hero::after { content: ""; position: absolute; width: 280px; height: 280px; border-radius: 50%; right: -90px; top: -110px; background: radial-gradient(circle, rgba(19,184,202,.18), rgba(19,184,202,0) 70%); pointer-events: none; }
.portal-hero-copy { max-width: 760px; position: relative; z-index: 1; }
.portal-eyebrow { color: #087a86; font-size: .76rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.portal-hero h2 { margin: 9px 0 10px; font-size: clamp(1.65rem, 4vw, 2.65rem); line-height: 1.08; color: #0b2947; }
.portal-hero p { margin: 0; color: var(--portal-muted); line-height: 1.65; max-width: 720px; }
.portal-section { margin-top: 24px; background: #fff; border: 1px solid var(--portal-border); border-radius: 18px; box-shadow: 0 10px 30px rgba(20, 55, 90, .08); overflow: hidden; }
.portal-section-heading { padding: 18px 22px; border-bottom: 1px solid #e6eef5; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.portal-section-heading h2, .portal-section-heading h3 { margin: 0; font-size: 1rem; color: #163651; }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; padding: 22px; }
.hub-card {
  min-height: 220px;
  border: 1px solid #dbe6f1;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #f8fbfd);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 8px 20px rgba(20, 55, 90, .07);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.hub-card:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgba(20, 55, 90, .13); border-color: #9fc5e8; }
.hub-card-icon { width: 82px; height: 82px; display: grid; place-items: center; border-radius: 22px; background: #edf6ff; }
.hub-card-icon img { width: 72px; height: 72px; border-radius: 18px; }
.hub-card-icon svg { width: 46px; height: 46px; fill: none; stroke: var(--portal-blue); stroke-width: 1.8; }
.hub-card h3 { margin: 0 0 6px; font-size: 1.08rem; }
.hub-card p { margin: 0; color: var(--portal-muted); font-size: .9rem; line-height: 1.5; }
.hub-card-arrow { font-weight: 800; color: var(--portal-blue); font-size: .84rem; }

.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); }
.login-visual { padding: clamp(30px, 6vw, 72px); background: radial-gradient(circle at 30% 20%, rgba(19,184,202,.28), transparent 31%), linear-gradient(145deg, #082d54, #0d5db1 65%, #0f8ea4); color: #fff; display: flex; flex-direction: column; justify-content: space-between; }
.login-visual .portal-brand img { width: 66px; height: 66px; border-radius: 18px; }
.login-message { max-width: 680px; padding: 50px 0; }
.login-message h1 { margin: 0 0 16px; font-size: clamp(2.15rem, 5vw, 4.1rem); line-height: 1; }
.login-message p { margin: 0; font-size: 1.05rem; line-height: 1.7; opacity: .86; max-width: 610px; }
.login-panel { background: #f8fbfd; display: grid; place-items: center; padding: 28px; }
.login-card { width: min(440px, 100%); background: #fff; border: 1px solid var(--portal-border); border-radius: 24px; padding: 34px; box-shadow: var(--portal-shadow); }
.login-card h2 { margin: 0 0 6px; font-size: 1.55rem; }
.login-card > p { margin: 0 0 24px; color: var(--portal-muted); line-height: 1.5; }
.portal-field { margin-bottom: 16px; }
.portal-field label { display: block; margin-bottom: 7px; font-size: .82rem; font-weight: 800; color: #314d67; }
.portal-field input, .portal-field select, .portal-search {
  width: 100%;
  border: 1px solid #cfdce8;
  background: #fff;
  border-radius: 12px;
  padding: 13px 14px;
  font: inherit;
  color: var(--portal-text);
  outline: none;
}
.portal-field input:focus, .portal-field select:focus, .portal-search:focus { border-color: #4ba2e7; box-shadow: 0 0 0 3px rgba(41, 137, 214, .12); }
.login-submit { width: 100%; margin-top: 4px; }
.login-status { min-height: 42px; margin-top: 16px; padding: 11px 13px; border-radius: 10px; font-size: .84rem; line-height: 1.45; display: none; }
.login-status.visible { display: block; }
.login-status.error { color: #8f2933; background: #fff0f1; border: 1px solid #ffd3d7; }
.login-status.info { color: #735512; background: #fff8e5; border: 1px solid #f2df9a; }

.portal-note { padding: 13px 15px; border-radius: 12px; font-size: .84rem; line-height: 1.5; }
.portal-note.info { background: #eef8ff; border: 1px solid #cde8fb; color: #24516f; }
.portal-note.warning { background: #fff8e7; border: 1px solid #f2dfa6; color: #745619; }
.portal-note.success { background: #edf9f4; border: 1px solid #cbeadd; color: #23644f; }

@media (max-width: 860px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-visual { min-height: 280px; padding: 28px; }
  .login-message { padding: 28px 0 0; }
  .login-message h1 { font-size: 2.3rem; }
  .portal-topbar-inner { min-height: 74px; }
  .portal-user-meta { display: none; }
  .portal-brand--portal-identity .portal-symbol { width: 58px; height: 58px; flex-basis: 58px; }
  .portal-brand-copy h1 { font-size: 1.08rem; }
  .portal-brand-copy p { font-size: .76rem; }
  .portal-hero { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 580px) {
  .portal-main, .portal-topbar-inner { width: min(100% - 20px, 1320px); }
  .portal-brand p { display: none; }
  .portal-brand img { width: 46px; height: 46px; }
  .portal-brand--portal-identity { flex: 1 1 0; gap: 10px; }
  .portal-brand--portal-identity .portal-symbol {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
  }
  .portal-brand-copy { max-width: min(58vw, 280px); }
  .portal-brand-copy h1 {
    font-size: .98rem;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .portal-grid { padding: 14px; grid-template-columns: 1fr; }
  .login-panel { padding: 16px; }
  .login-card { padding: 24px 20px; }
}
