@font-face {
  font-family: "Noto Sans";
  src: url("/fonts/NotoSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans";
  src: url("/fonts/NotoSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #091f36;
  --ink-soft: #29435d;
  --blue: #286ab4;
  --blue-bright: #4b91df;
  --arctic: #dceaf7;
  --porcelain: #f3f7fa;
  --white: #ffffff;
  --brass: #b79a58;
  --line: #cbd8e3;
  --danger: #ad2f3e;
  --shadow: 0 28px 70px rgba(9, 31, 54, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--porcelain);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--porcelain);
  font-family: "Noto Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.login-view {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(420px, 0.88fr);
  min-height: 100vh;
}

.brand-field {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  color: var(--white);
  background:
    radial-gradient(circle at 72% 24%, rgba(75, 145, 223, 0.42), transparent 28%),
    linear-gradient(145deg, #071a2c 0%, #0b2c50 58%, #174f82 100%);
}

.network-grid {
  position: absolute;
  inset: 0;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.11) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom right, black 0%, rgba(0, 0, 0, 0.65) 48%, transparent 80%);
}

.brand-field::after {
  content: "";
  position: absolute;
  width: 46vw;
  height: 46vw;
  min-width: 560px;
  min-height: 560px;
  right: -20vw;
  bottom: -21vw;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  box-shadow: 0 0 0 100px rgba(255, 255, 255, 0.025), 0 0 0 200px rgba(255, 255, 255, 0.02);
}

.brand-lockup {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100vh;
  max-width: 760px;
  padding: clamp(48px, 7vw, 110px);
}

.brand-kicker,
.section-label,
.app-type {
  color: var(--blue-bright);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-kicker {
  margin-bottom: 28px;
  color: #9dc6f2;
}

.brand-name {
  display: flex;
  flex-direction: column;
  font-family: "Avenir Next", "Noto Sans", sans-serif;
  font-size: clamp(4.5rem, 9vw, 9rem);
  font-weight: 700;
  letter-spacing: -0.075em;
  line-height: 0.75;
}

.brand-name span:last-child {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.68);
}

.brand-lockup p {
  max-width: 450px;
  margin: 42px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.05rem;
  line-height: 1.7;
}

.network-orbit {
  position: absolute;
  z-index: 1;
  top: 8%;
  right: 6%;
  width: min(30vw, 440px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 50%;
  transform: rotate(-12deg);
}

.network-orbit::before,
.network-orbit::after {
  content: "";
  position: absolute;
  inset: 15%;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
}

.network-orbit::after {
  inset: 34%;
  background: rgba(255, 255, 255, 0.04);
}

.orbit-node {
  position: absolute;
  width: 11px;
  height: 11px;
  background: var(--white);
  border: 3px solid rgba(75, 145, 223, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.08);
}

.orbit-node-a { top: 8%; left: 29%; }
.orbit-node-b { top: 62%; right: -1%; }
.orbit-node-c { bottom: 0; left: 29%; }

.orbit-label {
  position: absolute;
  top: 46%;
  left: 50%;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  transform: translate(-50%, -50%);
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: clamp(42px, 7vw, 110px);
  background: var(--white);
}

.mobile-brand {
  display: none;
}

.login-card {
  width: min(100%, 430px);
  margin: auto;
}

.login-heading {
  margin-bottom: 46px;
}

.login-heading h1,
.dashboard-intro h1 {
  margin: 12px 0 18px;
  font-family: "Avenir Next", "Noto Sans", sans-serif;
  font-size: clamp(2.7rem, 4.5vw, 4.6rem);
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.login-heading p {
  margin: 0;
  color: #65788a;
  line-height: 1.65;
}

.field {
  display: block;
  margin-top: 24px;
}

.field span {
  display: block;
  margin-bottom: 9px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.field input {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  color: var(--ink);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field input:focus {
  background: var(--white);
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(40, 106, 180, 0.12);
}

.form-error {
  min-height: 24px;
  margin: 14px 0 6px;
  color: var(--danger);
  font-size: 0.84rem;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 58px;
  padding: 0 20px;
  color: var(--white);
  background: var(--ink);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  transition: background 160ms ease, transform 160ms ease;
}

.primary-button:hover {
  background: var(--blue);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.login-footnote {
  width: min(100%, 430px);
  margin: 34px auto 0;
  color: #8795a2;
  font-size: 0.74rem;
  text-align: center;
}

.dashboard-view {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(9, 31, 54, 0.035) 1px, transparent 1px),
    var(--porcelain);
  background-size: 72px 100%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  padding: 0 clamp(24px, 6vw, 90px);
  color: var(--white);
  background: var(--ink);
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.monogram {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--white);
  background: var(--blue);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.portal-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.portal-brand-copy strong {
  font-size: 0.92rem;
}

.portal-brand-copy small {
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.68rem;
}

.quiet-button {
  padding: 10px 0;
  color: rgba(255, 255, 255, 0.75);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  font-size: 0.78rem;
}

.quiet-button:hover,
.quiet-button:focus-visible {
  color: var(--white);
  border-color: var(--white);
}

.dashboard-main {
  width: min(100% - 48px, 1240px);
  margin: 0 auto;
  padding: clamp(54px, 8vw, 104px) 0 34px;
}

.dashboard-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  padding-bottom: clamp(50px, 7vw, 88px);
}

.dashboard-intro h1 {
  margin-bottom: 0;
  font-size: clamp(3rem, 7vw, 6.8rem);
}

.date-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding-bottom: 8px;
  text-align: right;
}

.date-block span {
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.date-block strong {
  font-size: 0.95rem;
}

.apps-section {
  padding-top: 26px;
  border-top: 1px solid #b9c9d7;
}

.apps-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 30px;
}

.apps-heading h2 {
  margin: 8px 0 0;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  letter-spacing: -0.035em;
}

.app-count {
  color: #718394;
  font-size: 0.76rem;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.app-card {
  position: relative;
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  min-height: 420px;
  padding: clamp(28px, 4vw, 52px);
  overflow: hidden;
  color: var(--white);
  background: linear-gradient(125deg, #0a2747 0%, #103e69 66%, #286ab4 100%);
  border-radius: 8px;
  box-shadow: var(--shadow);
  text-decoration: none;
  isolation: isolate;
}

.app-card-finance {
  background: linear-gradient(125deg, #173f35 0%, #245d4e 68%, #3a7b69 100%);
}

.app-card-finance .app-symbol,
.app-card-finance .app-type {
  color: #b9dacd;
}

.app-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 440px;
  height: 440px;
  right: -150px;
  bottom: -210px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(255, 255, 255, 0.035), 0 0 0 140px rgba(255, 255, 255, 0.025);
  transition: transform 400ms ease;
}

.app-card:hover::before {
  transform: scale(1.08) translate(-12px, -8px);
}

.app-card-topline {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-index {
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 999px;
  font-size: 0.7rem;
}

.status-badge i {
  width: 7px;
  height: 7px;
  background: var(--brass);
  border-radius: 50%;
}

.status-badge.is-online i {
  background: #6ed69a;
  box-shadow: 0 0 0 4px rgba(110, 214, 154, 0.13);
}

.status-badge.is-offline i {
  background: #f07a83;
}

.app-symbol {
  grid-row: 2;
  align-self: center;
  color: #9dc6f2;
}

.app-symbol svg {
  width: 82px;
  height: 82px;
}

.app-card-copy {
  grid-row: 2;
  align-self: center;
  padding: 34px 30px;
}

.app-type {
  color: #9dc6f2;
}

.app-card-copy h3 {
  margin: 12px 0 14px;
  font-family: "Avenir Next", "Noto Sans", sans-serif;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  letter-spacing: -0.06em;
  line-height: 1;
}

.app-card-copy p {
  max-width: 480px;
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 1rem;
  line-height: 1.65;
}

.app-open {
  grid-column: 2 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 80px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.83rem;
  font-weight: 700;
}

.app-open b {
  font-size: 1.15rem;
}

.dashboard-footer {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding-top: 34px;
  color: #758696;
  font-size: 0.74rem;
}

.dashboard-footer p {
  margin: 0;
}

.loading-screen {
  position: fixed;
  z-index: 99;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--ink);
  transition: opacity 240ms ease, visibility 240ms ease;
}

.loading-screen.is-hidden {
  visibility: hidden;
  opacity: 0;
}

.loading-mark {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  animation: pulse 1.1s ease-in-out infinite alternate;
}

@keyframes pulse {
  to { transform: scale(1.07); background: rgba(255, 255, 255, 0.08); }
}

@media (max-width: 940px) {
  .login-view {
    grid-template-columns: 1fr;
  }

  .brand-field {
    display: none;
  }

  .login-panel {
    justify-content: space-between;
    padding: max(28px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
    background:
      radial-gradient(circle at 100% 0%, rgba(40, 106, 180, 0.12), transparent 34%),
      var(--white);
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 700;
  }

  .login-card {
    margin: 60px auto;
  }

  .apps-grid {
    grid-template-columns: 1fr;
  }

  .app-card {
    grid-template-columns: 100px minmax(0, 1fr);
  }

  .app-open {
    grid-column: 2;
  }
}

@media (max-width: 640px) {
  .topbar {
    min-height: 74px;
    padding: 0 20px;
  }

  .portal-brand-copy small {
    display: none;
  }

  .dashboard-main {
    width: min(100% - 32px, 1240px);
    padding-top: 42px;
  }

  .dashboard-intro {
    display: block;
    padding-bottom: 46px;
  }

  .dashboard-intro h1 {
    font-size: clamp(2.8rem, 14vw, 4.3rem);
  }

  .date-block {
    align-items: flex-start;
    margin-top: 30px;
    text-align: left;
  }

  .apps-heading {
    align-items: flex-start;
  }

  .app-card {
    display: flex;
    flex-direction: column;
    min-height: 450px;
    padding: 26px 24px;
  }

  .app-card-topline {
    width: 100%;
  }

  .app-symbol {
    margin: 46px 0 18px;
  }

  .app-symbol svg {
    width: 64px;
    height: 64px;
  }

  .app-card-copy {
    padding: 0;
  }

  .app-card-copy h3 {
    font-size: 2.7rem;
  }

  .app-open {
    width: 100%;
    margin-top: auto;
  }

  .dashboard-footer {
    display: block;
  }

  .dashboard-footer span {
    display: block;
    margin-top: 12px;
  }
}

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