:root {
  --navy-950: #00182d;
  --navy-900: #03213f;
  --navy-800: #0a3157;
  --gold-500: #f1bd00;
  --gold-400: #ffc928;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --text-main: #071d37;
  --text-muted: #67768d;
  --line: #d8e0e9;
  --shadow: 0 20px 55px rgba(0, 24, 52, 0.22);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  background: radial-gradient(circle at 12% 8%, rgba(38, 97, 148, 0.28), transparent 28rem), var(--navy-950);
}
button, input { font: inherit; }
p, h1, h2 { margin-top: 0; }

/* Small local fallbacks. Bootstrap remains the main framework, but the page
   still renders cleanly when the CDN is temporarily unavailable. */
.btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; cursor: pointer; }
.d-none { display: none !important; }
.d-flex { display: flex !important; }
.align-items-center { align-items: center !important; }
.w-100 { width: 100% !important; }
.input-group { display: flex; }
.form-control { display: block; width: 100%; }
.alert { position: relative; padding: 0.75rem 1rem; border: 1px solid transparent; border-radius: 0.5rem; }
.alert-success { color: #0f5132; background: #d1e7dd; border-color: #badbcc; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ui-icon {
  width: 1em;
  height: 1em;
  display: block;
  fill: none !important;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portal-page {
  min-height: 100vh;
  padding: clamp(1rem, 2.4vw, 2rem);
  display: grid;
  place-items: center;
}

.auth-shell {
  width: min(1200px, 100%);
  height: min(760px, calc(100svh - clamp(2.5rem, 6vw, 5rem)));
  min-height: 620px;
  display: grid;
  grid-template-columns: 57% 43%;
  grid-template-rows: auto 1fr;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

/* Shared left-side background for desktop. It spans both left content blocks,
   so the artwork remains continuous rather than restarting halfway down. */
.hero-background {
  position: absolute;
  inset: 0 auto 0 0;
  width: 59%;
  z-index: 0;
  overflow: hidden;
  clip-path: polygon(0 0, 89% 0, 100% 42%, 87% 100%, 0 100%);
  background:
    linear-gradient(90deg, rgba(46, 79, 107, 0.98) 0%, rgba(0, 29, 57, 0.91) 45%, rgba(2, 30, 57, 0.20) 100%),
    url("../images/layout_img/tower-mobile.jpg") right top / auto 118% no-repeat,
    var(--navy-900);
}

.hero-background::after {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: 12%;
  z-index: 2;
  clip-path: polygon(42% 0, 50% 0, 100% 42%, 50% 100%, 42% 100%, 91% 42%);
  background: linear-gradient(180deg, #ffd43e, #e0a900);
}


.hero-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50.7%;
  width: 8.6%;
  z-index: 4;
  pointer-events: none;
  clip-path: polygon(18% 0, 25% 0, 100% 42%, 28% 100%, 21% 100%, 92% 42%);
  /* background: linear-gradient(180deg, #ffd43e, #e0a900); */
}

.hero-background::before {
  content: "";
  position: absolute;
  left: -5.5rem;
  bottom: -6rem;
  width: 14rem;
  aspect-ratio: 1;
  border: 17px solid rgba(255, 202, 39, 0.8);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(255, 202, 39, 0.06), 0 0 0 44px rgba(255, 202, 39, 0.06);
}

.hero-intro-panel,
.hero-extras-panel {
  grid-column: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
  color: #fff;
  padding-left: clamp(2.8rem, 4.5vw, 4rem);
  padding-right: 15%;
}

.hero-intro-panel {
  grid-row: 1;
  padding-top: clamp(2.5rem, 4.6vh, 3.8rem);
}

.hero-extras-panel {
  grid-row: 2;
  min-height: 0;
  padding-top: clamp(1.4rem, 2.4vh, 2rem);
  padding-bottom: clamp(2rem, 3.2vh, 2.8rem);
  display: flex;
  flex-direction: column;
}

.hero-dots {
  position: absolute;
  width: 5.5rem;
  height: 5.5rem;
  left: 1.25rem;
  top: 1.25rem;
  opacity: 0.35;
  background-image: radial-gradient(circle, #a8bdd0 2.4px, transparent 2.8px);
  background-size: 19px 19px;
}

.brand-block { position: relative; z-index: 1; }
.brand-crest { width: clamp(6.8rem, 8vw, 8.8rem); height: auto; flex: 0 0 auto; object-fit: contain; }
.brand-name, .brand-tagline { margin-bottom: 0; }
.brand-name {
  font-size: clamp(1.12rem, 1.5vw, 1.5rem);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand-tagline {
  margin-top: 0.45rem;
  color: var(--gold-400);
  font-size: clamp(0.68rem, 0.8vw, 0.84rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.brand-rule { display: block; width: 5rem; height: 1px; margin-top: .9rem; background: rgba(255, 200, 39, 0.55); }

.hero-copy { margin-top: clamp(2.15rem, 4.2vh, 3.5rem); }
.eyebrow {
  margin-bottom: 1rem;
  color: var(--gold-400);
  font-size: clamp(0.8rem, 0.9vw, 0.92rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.eyebrow span { display: inline-block; width: 2.4rem; height: 2px; margin-left: 0.5rem; vertical-align: middle; background: var(--gold-400); }
.display-title {
  margin-bottom: 1rem;
  color: #fff;
  font-size: clamp(2.25rem, 3.25vw, 3.45rem);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  white-space: nowrap;
}
.display-title strong { display: block; margin-top: 0.42rem; color: var(--gold-400); font-weight: 800; }
.hero-description { max-width: 29rem; margin-bottom: 0; color: rgba(255,255,255,.92); font-size: clamp(.86rem,.95vw,1rem); line-height: 1.5; }

.feature-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: clamp(.8rem,1.15vw,1.2rem); padding-bottom: 15px;}
.feature-card {
  min-height: clamp(112px,14vh,132px);
  padding: .85rem .65rem .75rem;
  text-align: center;
  border: 1px solid rgba(190,210,229,.34);
  border-radius: 12px;
  background: rgba(0,29,57,.44);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(5px);
}
.feature-icon, .trust-icon { display: grid; place-items: center; color: var(--gold-400); }
.feature-icon { width: 48px; height: 48px; margin: 0 auto .65rem; font-size: 1.45rem; border: 1px solid rgba(255,255,255,.34); border-radius: 50%; }
.feature-card h2 { margin-bottom: .28rem; font-size: .88rem; font-weight: 700; }
.feature-card p { margin-bottom: 0; color: rgba(255,255,255,.8); font-size: .74rem; }
.trust-note {
  max-width: 32rem;
  margin-top: auto;
  margin-bottom: 0;
  padding: .72rem .95rem;
  gap: .8rem;
  border: 1px solid rgba(190,210,229,.28);
  border-radius: 12px;
  background: rgba(0,29,57,.48);
  line-height: 1.55;
}
.trust-icon { width: 2.3rem; min-width: 2.3rem; height: 2.3rem; font-size: 1.5rem; }
.trust-note p { margin-bottom: 0; font-size: .78rem; }
.trust-note strong { color: var(--gold-400); font-weight: 600; }

.login-panel {
  grid-column: 2;
  grid-row: 1 / 3;
  min-width: 0;
  min-height: 100%;
  margin-left: -8%;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(4.2rem,6vh,5.2rem) clamp(2rem,3.1vw,3rem) clamp(2rem,3vh,2.7rem) clamp(4.8rem,5.7vw,6.2rem);
  background: radial-gradient(circle at 54% 38%, rgba(230,237,244,.42), transparent 19rem), var(--surface);
}
.login-content { width: min(100%,360px); text-align: center; }
.theme-toggle {
  position: absolute;
  top: clamp(1.45rem,3vh,2.5rem);
  right: clamp(1.45rem,2.6vw,2.5rem);
  z-index: 5;
  gap: .75rem;
  min-height: 40px;
  padding: .4rem .9rem;
  color: var(--text-main);
  border: 1px solid rgba(7,29,55,.1);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 7px 18px rgba(7,29,55,.1);
  font-weight: 600;
  font-size: .86rem;
}
.theme-toggle:hover, .theme-toggle:focus-visible { color: var(--text-main); border-color: rgba(7,29,55,.2); background: var(--surface-soft); }
.theme-toggle .theme-icon { color: var(--gold-500); font-size: 1.3rem; }
.user-badge {
  width: 68px;
  height: 68px;
  margin: 0 auto .85rem;
  display: grid;
  place-items: center;
  color: var(--gold-400);
  font-size: 2.4rem;
  border-radius: 50%;
  background: var(--navy-900);
  box-shadow: 0 12px 24px rgba(3,33,63,.22);
}
.welcome-title { margin-bottom: 0; color: var(--text-main); font-size: clamp(1.45rem,1.7vw,1.72rem); line-height: 1.15; font-weight: 800; }
.welcome-subtitle { margin: .4rem 0 0; color: var(--text-muted); font-size: .86rem; line-height: 1.45; }
#login { width: 100%; margin-top: clamp(1.55rem,2.8vh,2.1rem); text-align: left; }
.form-field, .captcha-row, .sign-in-btn, .success-message { width: 100%; }
.form-label { display: block; margin: 0 0 .48rem; color: var(--text-main); font-size: .84rem; line-height: 1.25; font-weight: 700; }
.portal-input {
  min-height: 52px;
  align-items: stretch;
  flex-wrap: nowrap;
  overflow: visible;
  position: relative;
  border: 1px solid #cbd6e2;
  border-radius: 9px;
  background: transparent;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.portal-input:focus-within { border-color: var(--gold-500); box-shadow: 0 0 0 .2rem rgba(241,189,0,.12); }
.portal-input .input-group-text, .portal-input .form-control { min-height: 50px; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
.portal-input .input-group-text { width: 48px; min-width: 48px; display: grid; place-items: center; padding: 0; color: #718097; font-size: 1.08rem; }
.portal-input .form-control { min-width: 0; flex: 1 1 auto; width: 1%; padding: 0 1rem 0 .1rem; color: var(--text-main); font-size: .86rem; outline: 0; }
.portal-input .form-control::placeholder { color: #8591a4; }
.portal-input .invalid-feedback { position: absolute; left: 0; top: calc(100% - .5rem); font-size: .8rem; display: block; color: #dc3545;}
.was-validated .portal-input:has(.form-control:invalid), .portal-input:has(.form-control.is-invalid) { border-color: #dc3545; }
.portal-input:has(.form-control.is-valid) { border-color: #198754; }

.captcha-row { min-height: 52px; display: flex; gap: .7rem; margin-top: clamp(1.15rem,2vh,1.5rem); }
.captcha-box, .captcha-refresh { min-height: 52px; height: 52px; }
.captcha-box {
  min-width: 0;
  flex: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  color: #1f2a3b;
  border: 1px solid #cad6e4;
  border-radius: 9px;
  background: repeating-linear-gradient(14deg,transparent 0 27px,rgba(91,130,170,.16) 28px 30px), repeating-linear-gradient(-11deg,rgba(62,112,167,.06) 0 9px,transparent 10px 20px), #f5f8fc;
  font-family: Georgia,"Times New Roman",serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .42em;
  text-indent: .42em;
  user-select: none;
}
.captcha-box::before, .captcha-box::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.captcha-box::before { opacity: .45; background-image: radial-gradient(circle,#536b84 1px,transparent 1.4px); background-size: 25px 19px; }
.captcha-box::after { width: 118%; height: 2px; top: 52%; left: -9%; background: rgba(51,88,127,.33); transform: rotate(-8deg); }
.captcha-refresh { width: 60px; min-width: 60px; padding: 0; color: #fff; font-size: 1.45rem; border-radius: 9px; background: var(--navy-900); box-shadow: 0 8px 15px rgba(2,28,53,.14); }
.captcha-refresh:hover, .captcha-refresh:focus-visible { color: var(--gold-400); background: var(--navy-800); }
.captcha-field { margin-top: clamp(1.15rem,2vh,1.5rem); }
.sign-in-btn {
  min-height: 54px;
  margin-top: clamp(1.2rem,2.1vh,1.6rem);
  gap: .8rem;
  color: #fff;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(90deg,#dda900,#f0be00);
  box-shadow: 0 10px 22px rgba(222,171,0,.2);
  font-size: 1rem;
  font-weight: 700;
}
.sign-in-btn:hover, .sign-in-btn:focus-visible { color: #fff; background: linear-gradient(90deg,#c99600,#dda900); transform: translateY(-1px); }
.sign-in-btn .ui-icon { font-size: 1.1rem; }
.success-message { margin-top: 1rem; }
.support-block { width: 100%; margin-top: clamp(1.4rem,2.4vh,1.8rem); padding-top: clamp(1rem,1.8vh,1.3rem); gap: .75rem; color: var(--text-muted); border-top: 1px solid var(--line); text-align: left; }
.support-icon { width: 42px; min-width: 42px; height: 42px; display: grid; place-items: center; color: var(--gold-500); border-radius: 50%; background: rgba(241,189,0,.12); font-size: 1.2rem; }
.support-block p { margin-bottom: 0; line-height: 1.4; font-size: .82rem; }
.support-block a { color: #0669d5; font-weight: 700; text-decoration: none; }
.support-block a:hover, .support-block a:focus-visible { text-decoration: underline; }
/* .invalid-feedback { display: none; } */
/* .was-validated .form-control:invalid ~ .invalid-feedback, .form-control.is-invalid ~ .invalid-feedback { display: block; } */
.hero-copyright {font-size: 11px;}

[data-bs-theme="dark"] { --surface: #071b2f; --surface-soft: #0a2540; --text-main: #f2f6fb; --text-muted: #aebbd0; --line: #294057; }
[data-bs-theme="dark"] body { background: #000f1d; }
[data-bs-theme="dark"] .login-panel { background: radial-gradient(circle at 52% 36%,rgba(29,64,96,.28),transparent 20rem), var(--surface); }
[data-bs-theme="dark"] .theme-toggle { border-color: rgba(255,255,255,.1); }
[data-bs-theme="dark"] .portal-input { border-color: #3b536d; background: #0b233a; }
[data-bs-theme="dark"] .portal-input .input-group-text, [data-bs-theme="dark"] .portal-input .form-control { color: var(--text-main); }
[data-bs-theme="dark"] .portal-input .form-control::placeholder { color: #8797ab; }
[data-bs-theme="dark"] .captcha-box { color: #e7edf5; border-color: #3b536d; background: repeating-linear-gradient(14deg,transparent 0 27px,rgba(139,168,199,.12) 28px 30px), repeating-linear-gradient(-11deg,rgba(139,168,199,.05) 0 9px,transparent 10px 20px), #0b233a; }

@media (max-width: 1199.98px) and (min-width: 992px) {
  .hero-intro-panel, .hero-extras-panel { padding-left: 2.7rem; }
  .brand-crest { width: 6.6rem; }
  .brand-name { font-size: 1.15rem; }
  .display-title { font-size: clamp(2.2rem,3.35vw,3rem); }
  .login-panel { padding-right: 2rem; padding-left: 4.35rem; }
  .login-content { width: min(100%,350px); }
}

@media (min-width: 992px) and (max-height: 720px) {
  .auth-shell { min-height: 590px; }
  .hero-intro-panel { padding-top: 2.15rem; }
  .hero-copy { margin-top: 1.8rem; }
  .display-title { font-size: clamp(2.05rem, 3vw, 2.85rem); }
  .feature-card { min-height: 102px; }
  .login-panel { padding-top: 3.7rem; padding-bottom: 1.7rem; }
  .user-badge { width: 60px; height: 60px; font-size: 2.1rem; }
  #login { margin-top: 1.25rem; }
  .captcha-row, .captcha-field { margin-top: 1rem; }
  .sign-in-btn { margin-top: 1rem; }
  .support-block { margin-top: 1.1rem; padding-top: .9rem; }
}

/* Direct sibling ordering guarantees the requested responsive sequence. */
@media (max-width: 991.98px) {
  .portal-page { display: block; }
  .auth-shell { height: auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  .hero-background, .hero-divider { display: none; }

  .hero-intro-panel {
    order: 1;
    width: 100%;
    padding: 2.8rem 2.5rem 2.6rem;
    color: #fff;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(90deg,rgba(46, 79, 107,.98) 0%,rgba(0,29,57,.90) 55%,rgba(2,30,57,.34) 100%), url("../images/layout_img/tower-mobile.jpg") right top / auto 128% no-repeat, var(--navy-900);
  }
  .hero-intro-panel::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--gold-500); }
  .hero-dots { left: 1.2rem; top: 1rem; }
  .brand-block, .hero-copy { width: min(100%,690px); position: relative; z-index: 1; }
  .hero-copy { margin-top: 2.2rem; }
  .display-title { max-width: 680px; font-size: clamp(2.25rem,6vw,3.25rem); }
  .hero-description { max-width: 35rem; }

  .login-panel {
    order: 2;
    width: 100%;
    min-height: auto;
    margin-left: 0;
    padding: 5.25rem 2rem 3rem;
  }
  .login-content { width: min(100%,360px); }

  .hero-extras-panel {
    order: 3;
    width: 100%;
    min-height: auto;
    padding: 2.5rem 2.5rem 2.8rem;
    color: #fff;
    border-top: 5px solid var(--gold-500);
    background: linear-gradient(90deg,rgba(46, 79, 107,.98),rgba(0,29,57,.78)), url("../images/layout_img/tower-mobile.jpg") right bottom / auto 125% no-repeat, var(--navy-900);
  }
  .feature-grid { width: min(100%,760px); margin: 0 auto; }
  .trust-note { width: min(100%,620px); max-width: none; margin: 1.8rem auto 0; }
}

@media (max-width: 575.98px) {
  .portal-page { padding: 0; }
  .auth-shell { border: 0; border-radius: 0; }
  .hero-intro-panel { padding: 2.35rem 1.15rem 2.2rem; background: linear-gradient(90deg,rgba(46, 79, 107,.99),rgba(0,29,57,.80)), url("../images/layout_img/tower-mobile.jpg") 82% top / auto 132% no-repeat, var(--navy-900); }
  .hero-dots { left: .65rem; top: .55rem; }
  .brand-block { align-items: flex-start !important; }
  .brand-crest { width: 5.9rem; }
  .brand-name { white-space: normal; font-size: .98rem; }
  .brand-tagline { font-size: .68rem; }
  .brand-rule { width: 4.4rem; margin-top: .9rem; }
  .hero-copy { margin-top: 2rem; }
  .eyebrow { margin-bottom: 1rem; font-size: .82rem; }
  .display-title { margin-bottom: 1rem; font-size: clamp(2rem,10.8vw,2.85rem); white-space: normal; }
  .hero-description { font-size: .86rem; }

  .login-panel { padding: 4.9rem 1.15rem 2.6rem; }
  .theme-toggle { top: .85rem; right: .85rem; }
  .user-badge { width: 64px; height: 64px; font-size: 2.2rem; }
  .welcome-title { font-size: 1.6rem; }
  .welcome-subtitle { font-size: .84rem; }
  #login { margin-top: 1.85rem; }
  .portal-input, .captcha-box, .captcha-refresh { min-height: 52px; height: 52px; }
  .portal-input .input-group-text, .portal-input .form-control { min-height: 50px; }
  .portal-input .input-group-text { width: 48px; min-width: 48px; }
  .captcha-row, .captcha-field { margin-top: 1.2rem; }
  .captcha-row { min-height: 52px; gap: .65rem; }
  .captcha-refresh { width: 58px; min-width: 58px; }
  .captcha-box { font-size: 1.08rem; letter-spacing: .28em; text-indent: .28em; }
  .sign-in-btn { min-height: 54px; margin-top: 1.35rem; font-size: 1rem; }
  .support-block { align-items: flex-start !important; margin-top: 1.55rem; padding-top: 1.2rem; font-size: .82rem; }

  .hero-extras-panel { padding: 2rem 1.15rem 2.35rem; background: linear-gradient(90deg,rgba(46, 79, 107,.99),rgba(0,29,57,.86)), url("../images/layout_img/tower-mobile.jpg") right bottom / auto 118% no-repeat, var(--navy-900); }
  .feature-grid { grid-template-columns: 1fr; gap: .9rem; }
  .feature-card { min-height: 0; display: grid; grid-template-columns: 48px 1fr; grid-template-rows: auto auto; column-gap: 1rem; align-items: center; padding: .95rem 1rem; text-align: left; }
  .feature-icon { width: 48px; height: 48px; grid-row: 1 / 3; margin: 0; font-size: 1.5rem; }
  .feature-card h2 { align-self: end; margin-bottom: .2rem; }
  .feature-card p { align-self: start; }
  .trust-note { align-items: flex-start !important; margin-top: 1.8rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .sign-in-btn, .theme-toggle, .captcha-refresh { transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease; }
}
