:root {
  --navy: #0b1a3a;
  --navy-2: #0f2049;
  --navy-deep: #060f24;
  --mint: #3ddba8;
  --mint-2: #2ba37d;
  --mint-3: #4eeabb;
  --mint-soft: rgba(61, 219, 168, 0.1);
  --mint-glow: rgba(61, 219, 168, 0.25);
  --coral: #ff6b5c;
  --coral-soft: rgba(255, 107, 92, 0.1);
  --bone: #f4f2ec;
  --bone-faint: rgba(244, 242, 236, 0.32);
  --ink-mute: rgba(11, 26, 58, 0.62);
  --ink-faint: rgba(11, 26, 58, 0.32);
  --ink-line: rgba(11, 26, 58, 0.1);
  --font-sans: "Open Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-soft: 0 1px 3px rgba(11, 26, 58, 0.06), 0 4px 14px rgba(11, 26, 58, 0.05);
  --shadow-card: 0 1px 3px rgba(11, 26, 58, 0.06), 0 12px 32px rgba(11, 26, 58, 0.1);
  --shadow-mint: 0 8px 22px rgba(61, 219, 168, 0.32);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--bone);
  color: var(--navy);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(43, 163, 125, 0.3);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.login-layout {
  display: flex;
  min-height: 100dvh;
}

.brand-panel {
  position: relative;
  isolation: isolate;
  flex: 0 0 44%;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--navy-deep);
}

.brand-bg {
  position: absolute;
  inset: -4%;
  z-index: 0;
  background-image: url("/assets/login-bg.png");
  background-position: center;
  background-size: cover;
  animation: bg-drift 38s ease-in-out infinite alternate;
  will-change: transform;
}

.brand-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 50%, transparent 40%, rgba(6, 15, 36, 0.55) 100%),
    linear-gradient(180deg, rgba(6, 15, 36, 0.18) 0%, transparent 30%, transparent 70%, rgba(6, 15, 36, 0.35) 100%);
}

.starfield {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #d8efff;
  box-shadow: 0 0 6px rgba(216, 239, 255, 0.55);
  opacity: 0.35;
  animation: twinkle var(--star-duration, 4s) ease-in-out infinite;
  animation-delay: var(--star-delay, 0s);
}

.star:nth-child(4n) {
  width: 3px;
  height: 3px;
  background: #b9e8ff;
  opacity: 0.55;
}

.star:nth-child(11n) {
  background: var(--mint);
  box-shadow: 0 0 10px var(--mint-glow);
}

.brand-stage {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-orbits {
  position: relative;
  width: 680px;
  max-width: 82%;
  aspect-ratio: 1;
  --tilt: rotateX(72deg);
  --twist: rotateZ(-22deg);
  animation: logo-float 11s ease-in-out infinite;
  will-change: transform;
}

.orbit-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform: var(--twist);
}

.orbit-layer.back {
  z-index: 1;
  clip-path: inset(0 0 50% 0);
}

.orbit-layer.front {
  z-index: 3;
  clip-path: inset(50% 0 0 0);
}

.orbit-tilted {
  position: absolute;
  inset: 0;
  transform: var(--tilt);
  transform-origin: center;
}

.orbit-tilted::before {
  position: absolute;
  inset: -6%;
  border-radius: 50%;
  pointer-events: none;
  content: "";
  background: radial-gradient(ellipse at center, rgba(61, 219, 168, 0.1) 0%, transparent 65%);
}

.o-ring {
  position: absolute;
  box-sizing: border-box;
  border-radius: 50%;
}

.o-ring-outer {
  inset: 0;
  border: 1px solid rgba(61, 219, 168, 0.45);
}

.o-ring-inner {
  inset: 5%;
  border: 1px solid rgba(61, 219, 168, 0.28);
}

.sat-arm {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 0;
  transform-origin: 0 0;
  animation: arm-spin var(--sat-duration, 22s) linear infinite;
  animation-delay: var(--sat-delay, 0s);
}

.sat-slow {
  --sat-duration: 42s;
}

.sat-fast {
  --sat-duration: 28s;
  --sat-delay: -9s;
}

.sat-arm.r-outer {
  width: 50%;
}

.sat-arm.r-inner {
  width: 45%;
}

.sat-arm > .sat {
  position: absolute;
  top: 0;
  left: 100%;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: var(--mint-3);
  box-shadow: 0 0 10px var(--mint), 0 0 26px var(--mint-glow);
}

.sat-arm > .sat.sat-small {
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
}

.sat-arm > .sat.bone {
  background: #e8f5ff;
  box-shadow: 0 0 8px rgba(216, 239, 255, 0.7);
}

.brand-logo-lockup {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 36%;
  height: auto;
  transform: translate(-50%, -50%);
  filter:
    drop-shadow(0 4px 24px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 60px rgba(61, 219, 168, 0.22));
}

.brand-corner {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--bone-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-corner.tl {
  top: 28px;
  left: 32px;
}

.brand-corner.br {
  right: 32px;
  bottom: 28px;
}

.brand-corner .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

.form-panel {
  position: relative;
  display: flex;
  flex: 0 0 56%;
  min-width: 0;
  min-height: 100dvh;
  flex-direction: column;
  background: var(--bone);
}

.form-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 40px 0;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.form-topbar a {
  color: var(--ink-mute);
  text-decoration: none;
  transition: color 140ms ease;
}

.form-topbar a:hover {
  color: var(--mint-2);
}

.form-shell {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 2rem 2.5rem;
}

.form-inner {
  width: 100%;
  max-width: 460px;
}

.form-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--mint-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.form-eyebrow::before {
  width: 22px;
  height: 1px;
  content: "";
  background: var(--mint-2);
}

.form-title {
  margin-bottom: 16px;
  color: var(--navy);
  font-family: var(--font-sans);
  font-size: 3.25rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

.form-title em {
  color: var(--mint-2);
  font-style: normal;
}

.form-subtitle {
  margin-bottom: 32px;
  color: var(--ink-mute);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  text-wrap: pretty;
}

.form-card {
  margin-bottom: 22px;
  padding: 36px 34px;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.btn-google {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 15px 18px;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-sm);
  color: var(--navy);
  background: #fff;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 100ms ease;
}

.btn-google:hover:not(:disabled) {
  border-color: rgba(11, 26, 58, 0.22);
  box-shadow: 0 4px 14px rgba(11, 26, 58, 0.08);
  transform: translateY(-1px);
}

.btn-google:active:not(:disabled) {
  transform: translateY(0);
}

.btn-google:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.btn-google svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.divider::before,
.divider::after {
  height: 1px;
  flex: 1;
  content: "";
  background: var(--ink-line);
}

.divider span {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.magic-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 18px;
  height: 18px;
  color: var(--ink-faint);
  pointer-events: none;
  transform: translateY(-50%);
}

.magic-form input[type="email"] {
  width: 100%;
  padding: 15px 16px 15px 46px;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--navy);
  background: #fff;
  font-family: var(--font-sans);
  font-size: 15px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.magic-form input::placeholder {
  color: var(--ink-faint);
}

.magic-form input:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px var(--mint-glow);
}

.btn-magic {
  position: relative;
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  padding: 15px 18px;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--navy);
  background: var(--mint);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 150ms ease, box-shadow 150ms ease, transform 100ms ease;
}

.btn-magic:hover:not(:disabled) {
  background: var(--mint-3);
  box-shadow: var(--shadow-mint);
  transform: translateY(-1px);
}

.btn-magic:active:not(:disabled) {
  transform: translateY(0);
}

.btn-magic:disabled {
  cursor: wait;
  opacity: 0.6;
}

.btn-magic .arrow {
  transition: transform 200ms ease;
}

.btn-magic:hover .arrow {
  transform: translateX(3px);
}

.btn-microcopy {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  line-height: 1.5;
  text-align: center;
}

.auth-message {
  min-height: 0;
  margin-top: 0;
  color: var(--coral);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.auth-message:not(:empty) {
  min-height: 1.5em;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 107, 92, 0.22);
  border-radius: var(--radius-md);
  background: var(--coral-soft);
}

.inbox-screen {
  padding: 8px 4px 4px;
  text-align: center;
  animation: inbox-in 350ms ease-out;
}

.inbox-icon-wrap {
  position: relative;
  display: flex;
  width: 64px;
  height: 64px;
  align-items: center;
  justify-content: center;
  margin: 4px auto 22px;
  border-radius: 50%;
  color: var(--mint-2);
  background: var(--mint-soft);
}

.inbox-icon-wrap::after {
  position: absolute;
  inset: -6px;
  border: 1px solid var(--mint-soft);
  border-radius: 50%;
  content: "";
  animation: inbox-ring 2.4s ease-in-out infinite;
}

.inbox-icon-wrap svg {
  width: 28px;
  height: 28px;
}

.inbox-title {
  margin-bottom: 10px;
  color: var(--navy);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.inbox-text {
  margin-bottom: 20px;
  color: var(--ink-mute);
  font-size: 15px;
  line-height: 1.6;
}

.inbox-text strong {
  color: var(--navy);
  font-weight: 600;
}

.inbox-back {
  padding: 6px 10px;
  border: 0;
  color: var(--ink-mute);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 140ms ease;
}

.inbox-back:hover {
  color: var(--mint-2);
}

.security-pill {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  border: 1px solid var(--ink-line);
  border-radius: 100px;
  color: var(--ink-mute);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  line-height: 1.4;
  text-align: center;
  text-transform: uppercase;
}

.security-lock {
  position: relative;
  width: 12px;
  height: 10px;
  flex: 0 0 auto;
  border: 1.5px solid var(--mint-2);
  border-radius: 2px;
}

.security-lock::before {
  position: absolute;
  bottom: 7px;
  left: 50%;
  width: 7px;
  height: 6px;
  border: 1.5px solid var(--mint-2);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  content: "";
  transform: translateX(-50%);
}

.dashboard-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.sign-out-button {
  flex: 0 0 auto;
  margin-top: 3px;
  padding: 10px 12px;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-sm);
  color: var(--ink-mute);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease;
}

.sign-out-button:hover {
  border-color: rgba(255, 107, 92, 0.34);
  color: var(--coral);
}

.identity-line {
  margin: 4px 0 24px;
  color: var(--ink-mute);
  font-size: 13px;
  line-height: 1.5;
}

.identity-line strong {
  color: var(--navy);
  font-weight: 600;
}

.dashboard-list {
  display: grid;
  gap: 12px;
}

.dashboard-link {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 104px;
  align-items: center;
  gap: 18px;
  overflow: hidden;
  padding: 19px 20px;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-lg);
  color: var(--navy);
  background: #fff;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 100ms ease;
}

.dashboard-link:hover {
  border-color: rgba(61, 219, 168, 0.58);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.dashboard-number {
  color: var(--mint-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.dashboard-copy {
  display: grid;
  gap: 5px;
}

.dashboard-copy strong {
  font-size: 16px;
  letter-spacing: -0.01em;
}

.dashboard-copy small {
  color: var(--ink-mute);
  font-size: 12.5px;
  line-height: 1.45;
}

.dashboard-arrow {
  color: var(--mint-2);
  font-size: 18px;
  transition: transform 180ms ease;
}

.dashboard-link:hover .dashboard-arrow {
  transform: translateX(3px);
}

.dashboard-note {
  margin-top: 18px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 40px 28px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

@keyframes bg-drift {
  0% {
    transform: scale(1.04) translate(-0.6%, -0.4%);
  }
  100% {
    transform: scale(1.1) translate(0.8%, 0.6%);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.15;
    transform: scale(0.9);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.25);
  }
}

@keyframes arm-spin {
  from {
    transform: rotateX(72deg) rotate(0deg);
  }
  to {
    transform: rotateX(72deg) rotate(360deg);
  }
}

@keyframes logo-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(61, 219, 168, 0.55);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(61, 219, 168, 0);
  }
}

@keyframes inbox-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes inbox-ring {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0;
    transform: scale(1.15);
  }
}

@media (max-width: 880px) {
  .login-layout {
    flex-direction: column;
  }

  .brand-panel {
    min-height: 220px;
    flex: 0 0 220px;
  }

  .brand-orbits {
    width: 280px;
  }

  .brand-corner {
    display: none;
  }

  .form-panel {
    min-height: calc(100dvh - 220px);
    flex: 1;
  }

  .form-topbar {
    padding: 16px 20px 0;
  }

  .form-shell {
    padding: 1.5rem 1.25rem 1rem;
  }

  .form-title {
    font-size: 2rem;
  }

  .form-footer {
    flex-wrap: wrap;
    padding: 16px 20px 24px;
  }
}

@media (max-width: 480px) {
  .brand-panel {
    min-height: 180px;
    flex-basis: 180px;
  }

  .brand-orbits {
    width: 240px;
  }

  .form-card {
    padding: 22px 20px;
  }

  .security-pill {
    padding-inline: 14px;
    font-size: 9.5px;
    letter-spacing: 0.05em;
  }

  .dashboard-heading {
    align-items: center;
  }

  .dashboard-link {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .dashboard-arrow {
    display: none;
  }
}

@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;
  }
}
