:root {
  --navy: #0b2940;
  --navy-deep: #071f32;
  --teal: #1395a0;
  --aqua: #62d2d2;
  --ink: #14324a;
  --muted: #607486;
  --line: rgba(17, 107, 120, 0.16);
  --surface: rgba(255, 255, 255, 0.86);
  --shadow: 0 32px 80px rgba(8, 46, 68, 0.16);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: #eef7f8; overflow-x: clip; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: clip;
  color: var(--ink);
  font-family: "DM Sans", Arial, sans-serif;
  background:
    radial-gradient(circle at 86% 13%, rgba(99, 214, 213, 0.32), transparent 23rem),
    radial-gradient(circle at 7% 88%, rgba(53, 166, 180, 0.18), transparent 28rem),
    linear-gradient(135deg, #f8fbfc 0%, #eef8f9 54%, #e7f5f6 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(20, 129, 143, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 129, 143, 0.055) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, transparent, black 15%, black 75%, transparent);
}

button, a { font: inherit; }

.page-shell {
  width: min(100%, 1480px);
  height: 100vh;
  height: 100svh;
  min-height: 680px;
  margin: 0 auto;
  padding: clamp(20px, 2.7vh, 30px) 62px clamp(16px, 2.2vh, 24px);
  display: grid;
  grid-template-rows: 76px minmax(0, 1fr) 42px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.page-shell::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 480px;
  height: 480px;
  border: 1px solid rgba(24, 142, 153, 0.11);
  border-radius: 50%;
  right: -140px;
  top: 8%;
  box-shadow: 0 0 0 70px rgba(24, 142, 153, 0.035), 0 0 0 142px rgba(24, 142, 153, 0.025);
}

.site-header {
  display: flex;
  align-items: center;
}

.brand-logo { width: clamp(250px, 24vw, 346px); height: auto; display: block; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(400px, 0.78fr);
  align-items: center;
  gap: clamp(52px, 8vw, 130px);
  min-height: 0;
  padding: clamp(24px, 4vh, 46px) 4vw;
}

.hero-copy { max-width: 730px; }

h1, h2 { font-family: "Manrope", "DM Sans", sans-serif; margin: 0; color: var(--navy); }
h1 { font-size: clamp(3.5rem, 5.8vw, 5.8rem); line-height: 0.98; letter-spacing: -0.065em; font-weight: 800; }
h1 em { color: var(--teal); font-style: normal; }
.intro { max-width: 610px; margin: 20px 0 0; color: #4c6578; font-size: clamp(1.05rem, 1.4vw, 1.22rem); line-height: 1.58; }

.feature-row { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 32px; }
.feature { display: flex; align-items: center; gap: 12px; min-width: 150px; }
.feature-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(19,149,160,.18); border-radius: 14px; background: rgba(255,255,255,.58); }
.feature-icon svg { width: 22px; fill: none; stroke: var(--teal); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature strong, .feature span { display: block; }
.feature strong { color: var(--navy); font-size: .94rem; margin-bottom: 2px; }
.feature span { color: var(--muted); font-size: .78rem; }

.login-card {
  position: relative;
  overflow: hidden;
  max-width: 510px;
  justify-self: end;
  width: 100%;
  padding: clamp(28px, 3.4vw, 44px);
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 34px;
  background: var(--surface);
  box-shadow: var(--shadow), inset 0 1px 0 white;
  backdrop-filter: blur(24px);
}

.login-card::before { content: ""; position: absolute; width: 220px; height: 220px; right: -105px; top: -110px; border-radius: 50%; background: linear-gradient(145deg, rgba(88,207,209,.22), rgba(18,142,153,.04)); }
.card-mark { width: 58px; height: 58px; border-radius: 19px; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), #104a63); box-shadow: 0 15px 34px rgba(9,50,70,.22); margin-bottom: 26px; }
.card-mark svg { width: 34px; fill: var(--aqua); }
.secure-label { color: var(--teal); font-size: .76rem; font-weight: 800; letter-spacing: .17em; }
.card-copy h2 { font-size: clamp(2rem, 3vw, 2.55rem); line-height: 1.14; letter-spacing: -.045em; margin-top: 10px; }
.card-copy p { margin: 16px 0 24px; color: var(--muted); font-size: 1rem; line-height: 1.58; }

.microsoft-button, .dialog-action {
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.microsoft-button { width: 100%; min-height: 62px; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px 20px; color: white; background: var(--navy); box-shadow: 0 14px 28px rgba(8,41,63,.18); }
.microsoft-button:hover { transform: translateY(-2px); background: #103b54; box-shadow: 0 18px 32px rgba(8,41,63,.24); }
.microsoft-button:active { transform: translateY(0); }
.microsoft-button:disabled { cursor: wait; opacity: .72; transform: none; box-shadow: none; }
.microsoft-button:focus-visible, .dialog-action:focus-visible, .dialog-close:focus-visible { outline: 3px solid rgba(39, 174, 187, .42); outline-offset: 3px; }
.arrow { width: 21px; fill: none; stroke: white; stroke-width: 1.8; margin-left: auto; }
.ms-logo { width: 21px; height: 21px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; flex: 0 0 auto; }
.ms-logo i:nth-child(1) { background: #f35325; }
.ms-logo i:nth-child(2) { background: #81bc06; }
.ms-logo i:nth-child(3) { background: #05a6f0; }
.ms-logo i:nth-child(4) { background: #ffba08; }

.security-note { display: flex; align-items: center; justify-content: center; gap: 8px; color: #6a7e8e; font-size: .82rem; margin-top: 18px; }
.security-note svg { width: 18px; fill: none; stroke: #379aa5; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.auth-status { min-height: 1.25rem; margin: 12px 0 -8px; color: #4c6578; font-size: .84rem; line-height: 1.4; text-align: center; }
.auth-status.error { color: #a93838; }

footer { display: flex; align-items: center; justify-content: center; gap: 14px; color: #718291; font-size: .8rem; text-align: center; }

dialog { width: min(92vw, 560px); padding: 38px; border: 1px solid rgba(21,118,131,.16); border-radius: 26px; color: var(--ink); box-shadow: 0 32px 100px rgba(5,39,58,.32); }
dialog::backdrop { background: rgba(5, 27, 42, .62); backdrop-filter: blur(8px); }
.dialog-close { position: absolute; top: 16px; right: 18px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #edf6f7; color: var(--navy); font-size: 1.5rem; cursor: pointer; }
.dialog-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; background: #edf7f8; margin-bottom: 24px; }
dialog h2 { font-size: 1.8rem; letter-spacing: -.03em; }
dialog > p { color: var(--muted); line-height: 1.6; }
.portal-options { display: grid; gap: 12px; margin: 26px 0; }
.portal-option { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; min-height: 82px; padding: 14px 16px; border: 1px solid rgba(19,149,160,.16); border-radius: 16px; color: var(--ink); background: #f3f9fa; text-decoration: none; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.portal-option:hover { transform: translateY(-2px); border-color: rgba(19,149,160,.42); box-shadow: 0 12px 24px rgba(8,46,68,.09); }
.portal-option:focus-visible { outline: 3px solid rgba(39,174,187,.42); outline-offset: 3px; }
.portal-option-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: white; }
.portal-option-icon svg { width: 24px; fill: none; stroke: var(--teal); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.portal-option strong, .portal-option small { display: block; }
.portal-option strong { color: var(--navy); font-size: 1rem; }
.portal-option small { color: var(--muted); font-size: .8rem; margin-top: 3px; }
.option-arrow { width: 20px; fill: none; stroke: var(--teal); stroke-width: 1.8; }
.dialog-actions { display: flex; gap: 10px; margin-top: 8px; }
.dialog-action { min-height: 46px; padding: 12px 18px; display: inline-flex; align-items: center; justify-content: center; background: var(--teal); color: white; text-decoration: none; }
.dialog-action:hover { background: #0f818b; }
.dialog-action.secondary { color: var(--navy); background: #eaf3f4; }
.dialog-action.secondary:hover { background: #dcecee; }
.dialog-action.contact { display: none; flex: 1; }
.access-denied .dialog-icon { background: #fff2f1; }
.access-denied .secure-label { color: #ad4039; }
.access-denied .portal-options { display: none; }
.access-denied .dialog-action.contact { display: inline-flex; }

@media (max-width: 960px) {
  .page-shell { height: auto; min-height: 100svh; padding: 24px 30px; grid-template-rows: auto 1fr auto; overflow: visible; }
  .hero { grid-template-columns: 1fr; gap: 52px; padding: 52px 2vw 60px; }
  .hero-copy { text-align: center; margin: 0 auto; }
  .intro { margin-left: auto; margin-right: auto; }
  .feature-row { justify-content: center; }
  .login-card { justify-self: center; max-width: 560px; }
}

@media (max-width: 620px) {
  .page-shell { padding: 18px; }
  .brand-logo { width: 230px; }
  .hero { padding: 48px 0; }
  h1 { font-size: clamp(3rem, 15vw, 4.4rem); }
  .intro { font-size: 1rem; }
  .feature-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .feature { min-width: 0; flex-direction: column; gap: 8px; text-align: center; }
  .feature span { display: none; }
  .login-card { padding: 30px 24px; border-radius: 26px; }
  .card-mark { margin-bottom: 28px; }
  footer { flex-direction: column; gap: 4px; }
  dialog { padding: 32px 22px 24px; }
  .portal-option { grid-template-columns: auto 1fr; }
  .option-arrow { display: none; }
  .dialog-actions { flex-direction: column; }
}

@media (min-width: 961px) and (max-height: 820px) {
  .page-shell { min-height: 620px; grid-template-rows: 64px minmax(0, 1fr) 34px; padding-top: 14px; padding-bottom: 10px; }
  .brand-logo { width: 270px; }
  .hero { gap: clamp(40px, 7vw, 96px); padding: 14px 3vw 22px; }
  h1 { font-size: clamp(3.3rem, 5.2vw, 4.8rem); }
  .intro { margin-top: 14px; font-size: 1.02rem; }
  .feature-row { margin-top: 22px; }
  .login-card { max-width: 470px; padding: 26px 32px; border-radius: 28px; }
  .card-mark { width: 50px; height: 50px; margin-bottom: 20px; }
  .card-mark svg { width: 30px; }
  .card-copy h2 { font-size: 2rem; }
  .card-copy p { margin: 12px 0 18px; line-height: 1.5; }
  .microsoft-button { min-height: 56px; }
  .security-note { margin-top: 14px; }
  .auth-status { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
