:root {
  --portal-abyss: #04141f;
  --portal-deep: #08293a;
  --portal-ocean: #0d526b;
  --portal-foam: #d9f2f3;
  --portal-aqua: #57c7c5;
  --portal-sand: #e6cda2;
  --portal-ink: #0e2b3a;
  --portal-muted: #637986;
  --portal-line: rgba(190, 219, 224, .68);
  --portal-white: #fdfefe;
  --portal-shadow: 0 30px 80px rgba(1, 14, 23, .3);
}

* { box-sizing: border-box; }

.portal-page,
.auth-page.portal-auth-page {
  min-height: 100vh;
  margin: 0;
  color: var(--portal-ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(87, 199, 197, .16), transparent 29rem),
    linear-gradient(135deg, var(--portal-abyss) 0%, #062131 46%, #0b4055 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.portal-page::before,
.portal-page::after,
.auth-page.portal-auth-page::before,
.auth-page.portal-auth-page::after {
  position: fixed;
  z-index: 0;
  content: "";
  pointer-events: none;
}

.portal-page::before,
.auth-page.portal-auth-page::before {
  inset: auto -10vw -24vh 25vw;
  height: 52vh;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(180deg, rgba(54, 154, 174, .15), rgba(4, 20, 31, .04));
  transform: rotate(-6deg);
}

.portal-page::after,
.auth-page.portal-auth-page::after {
  inset: 0;
  opacity: .15;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom right, #000, transparent 64%);
}

.portal-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
  min-height: 100vh;
  overflow: hidden;
}

.portal-story {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 5vw, 5.5rem);
  color: #f3fbfc;
}

.portal-brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: .9rem;
  color: inherit;
  text-decoration: none;
}

.portal-brand > span:last-child { display: grid; gap: .22rem; }
.portal-brand strong { font-size: .98rem; letter-spacing: .16em; }
.portal-brand small { color: #96c5cc; font-size: .6rem; font-weight: 700; letter-spacing: .11em; }

.portal-mark {
  position: relative;
  display: block;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(178, 231, 232, .36);
  border-radius: 50%;
  background: rgba(255,255,255,.04);
}

.portal-mark::before,
.portal-mark i,
.portal-mark b { position: absolute; display: block; content: ""; }
.portal-mark::before { left: 1.32rem; top: .55rem; width: 1px; height: 1.55rem; background: #9be0df; }
.portal-mark i { left: .55rem; top: .62rem; width: .72rem; height: 1.42rem; background: #f3fbfc; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.portal-mark b { left: 1.42rem; top: .72rem; width: .65rem; height: 1.32rem; background: var(--portal-aqua); clip-path: polygon(0 0, 100% 100%, 0 100%); }
.portal-mark::after { position: absolute; left: .54rem; bottom: .46rem; width: 1.65rem; height: .38rem; border-bottom: 2px solid var(--portal-sand); border-radius: 50%; content: ""; }

.portal-story-copy { max-width: 47rem; margin: auto 0; padding: 5rem 0; }
.portal-eyebrow { margin: 0 0 .85rem; color: var(--portal-aqua); font-size: .68rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.portal-story h1 { max-width: 13ch; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(3rem, 6.6vw, 6.8rem); font-weight: 400; letter-spacing: -.045em; line-height: .94; text-wrap: balance; }
.portal-lead { max-width: 42rem; margin: 1.65rem 0 0; color: #b9d5d9; font-size: clamp(1rem, 1.35vw, 1.25rem); line-height: 1.75; }
.portal-story blockquote { max-width: 39rem; margin: 0; padding-left: 1rem; border-left: 2px solid var(--portal-sand); color: #dceced; font-family: Georgia, "Times New Roman", serif; font-size: clamp(.96rem, 1.35vw, 1.15rem); font-style: italic; line-height: 1.55; }

.portal-waterline { position: absolute; right: -7%; bottom: 9%; display: grid; width: 42%; gap: .5rem; opacity: .3; transform: rotate(-5deg); }
.portal-waterline span { display: block; height: 1px; background: linear-gradient(90deg, transparent, #86d7db, transparent); }
.portal-waterline span:nth-child(2) { margin-left: 13%; }
.portal-waterline span:nth-child(3) { margin-left: 28%; }

.portal-access {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: clamp(1rem, 4vw, 4rem);
  border-left: 1px solid rgba(255,255,255,.1);
  background: rgba(244, 250, 250, .96);
  box-shadow: -30px 0 90px rgba(0, 13, 21, .2);
}

.portal-language {
  position: absolute;
  top: clamp(1.2rem, 3vw, 2.5rem);
  right: clamp(1.2rem, 3vw, 2.5rem);
  display: flex;
  gap: .2rem;
  padding: .25rem;
  border: 1px solid #cfdddf;
  border-radius: 999px;
  background: rgba(255,255,255,.7);
}
.portal-language a { display: grid; min-width: 2.35rem; min-height: 2rem; place-items: center; border-radius: 999px; color: #637985; font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-decoration: none; }
.portal-language a[aria-current="true"] { background: var(--portal-deep); color: #fff; }
.portal-language a:focus-visible { outline: 3px solid rgba(30, 144, 160, .28); outline-offset: 2px; }

.portal-login-card,
.portal-access > .auth-panel {
  width: min(100%, 29rem);
  margin: 3.5rem auto 1rem;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.portal-login-card h2,
.portal-access > .auth-panel h2 { margin: 0; color: var(--portal-ink); font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3rem); font-weight: 400; line-height: 1.08; }
.portal-login-card > p:not(.portal-eyebrow):not(.portal-access-status):not(.portal-fallback) { color: var(--portal-muted); line-height: 1.6; }

.portal-login-card form,
.portal-auth-form { display: grid; gap: 1rem; margin-top: 2rem; }
.portal-login-card label,
.portal-auth-form label { display: grid; gap: .45rem; color: #395463; font-size: .78rem; font-weight: 750; }
.portal-login-card input,
.portal-auth-form input,
.portal-access > .auth-panel input { width: 100%; min-height: 3.35rem; padding: .75rem .9rem; border: 1px solid #c6d6d9; border-radius: .65rem; outline: 0; background: rgba(255,255,255,.88); color: var(--portal-ink); font: inherit; box-shadow: inset 0 1px 2px rgba(4,20,31,.03); }
.portal-login-card input:focus,
.portal-auth-form input:focus,
.portal-access > .auth-panel input:focus { border-color: #2d8d9c; box-shadow: 0 0 0 4px rgba(45,141,156,.13); }

.portal-submit,
.portal-auth-form .button.primary,
.portal-access > .auth-panel .button.primary { display: inline-flex; min-height: 3.45rem; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .25rem; padding: .78rem 1rem; border: 1px solid var(--portal-deep); border-radius: .65rem; background: var(--portal-deep); color: #fff; font: inherit; font-weight: 800; cursor: pointer; box-shadow: 0 12px 28px rgba(8,41,58,.16); }
.portal-submit:disabled { cursor: wait; opacity: .45; }
.portal-submit:not(:disabled):hover,
.portal-auth-form .button.primary:hover { background: #0b4057; }
.portal-submit:focus-visible,
.portal-auth-form .button.primary:focus-visible { outline: 3px solid rgba(30,144,160,.28); outline-offset: 3px; }

.portal-form-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1.15rem; color: #71838c; font-size: .75rem; }
.portal-form-links a,
.portal-access .subtle-link,
.portal-fallback a { color: #15677b; font-weight: 750; text-decoration: none; }
.portal-form-links a:hover,
.portal-access .subtle-link:hover,
.portal-fallback a:hover { text-decoration: underline; }
.portal-access-status { min-height: 1.25rem; margin: 1rem 0 0; color: #71838c; font-size: .74rem; }
.portal-fallback { margin-top: .85rem; font-size: .8rem; }
.portal-access .form-error { margin: 1rem 0 0; border: 1px solid #e4b9b5; border-radius: .65rem; background: #fff3f1; color: #8b382f; }
.portal-access .flash { margin: 1rem 0 0; border-radius: .65rem; }
.portal-access .language-switch { display: none; }

@media (max-width: 900px) {
  .portal-shell { grid-template-columns: 1fr; }
  .portal-story { min-height: 48vh; padding: 1.5rem; }
  .portal-story-copy { padding: 4.5rem 0 3.25rem; }
  .portal-story h1 { font-size: clamp(2.7rem, 11vw, 5rem); }
  .portal-story blockquote { max-width: 31rem; padding-left: .75rem; font-size: .88rem; }
  .portal-access { min-height: 52vh; padding: 5.5rem 1.25rem 2rem; border-top: 1px solid rgba(255,255,255,.16); border-left: 0; box-shadow: 0 -20px 60px rgba(0,13,21,.16); }
  .portal-login-card, .portal-access > .auth-panel { margin-top: 0; }
}

@media (max-width: 520px) {
  .portal-brand strong { font-size: .84rem; }
  .portal-brand small { max-width: 16rem; font-size: .53rem; }
  .portal-story { min-height: 43vh; }
  .portal-story-copy { padding: 3.5rem 0 2rem; }
  .portal-lead { font-size: .92rem; line-height: 1.6; }
  .portal-access { min-height: 57vh; padding-top: 5rem; }
  .portal-form-links { align-items: flex-start; flex-direction: column; }
}

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