:root {
  --sn-ink: #0b1720;
  --sn-navy: #102b38;
  --sn-teal: #8b5cf6;
  --sn-teal-dark: #6d28d9;
  --sn-mint: #ddd6fe;
  --sn-cloud: #f8f7fc;
  --sn-line: #e6e1f1;
  --sn-muted: #687d84;
  --sn-error: #c64242;
  --sn-success: #087d61;
}

* {
  box-sizing: border-box;
}

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

body.auth-login {
  margin: 0;
  background: var(--sn-cloud);
  color: var(--sn-ink);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

.safenet-auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
}

.auth-story {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow: hidden;
  padding: clamp(32px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  color: #fff;
  background:
    radial-gradient(circle at 74% 15%, rgba(72, 211, 165, 0.22), transparent 28%),
    linear-gradient(145deg, #171225 0%, #2b1d48 57%, #3c2466 100%);
}

.story-grid {
  position: absolute;
  inset: 0;
  z-index: -3;
  opacity: 0.08;
  background-image:
    linear-gradient(rgba(255,255,255,.38) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.38) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom right, #000, transparent 75%);
}

.story-glow {
  position: absolute;
  z-index: -2;
  border-radius: 999px;
  filter: blur(4px);
}

.story-glow-one {
  width: 420px;
  height: 420px;
  right: -230px;
  top: 30%;
  border: 1px solid rgba(158, 232, 200, .3);
  box-shadow: 0 0 100px rgba(21, 166, 132, .16) inset;
}

.story-glow-two {
  width: 190px;
  height: 190px;
  left: 47%;
  bottom: -85px;
  background: rgba(21, 166, 132, .13);
}

.brand-lockup,
.mobile-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-lockup strong,
.mobile-brand strong {
  display: block;
  font-size: 17px;
  letter-spacing: .01em;
}

.brand-lockup small {
  display: block;
  margin-top: 3px;
  color: rgba(255,255,255,.56);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--sn-mint), var(--sn-teal));
  box-shadow: 0 12px 30px rgba(5, 70, 60, .28);
}

.brand-mark span {
  position: absolute;
  top: 11px;
  width: 7px;
  height: 21px;
  border-radius: 8px;
  background: #0b2732;
  transform: rotate(-34deg);
}

.brand-mark span:first-child {
  left: 12px;
  height: 14px;
}

.brand-mark span:last-child {
  right: 11px;
  transform: rotate(34deg);
}

.story-content {
  width: min(620px, 100%);
  margin: auto 0;
  padding: 80px 0;
}

.eyebrow,
.auth-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--sn-mint);
}

.eyebrow span {
  width: 24px;
  height: 1px;
  background: currentColor;
}

.story-content h1 {
  max-width: 580px;
  margin: 22px 0 20px;
  color: #fff;
  font-size: clamp(42px, 5.5vw, 76px);
  line-height: .98;
  letter-spacing: -.055em;
  font-weight: 740;
}

.story-content > p {
  max-width: 550px;
  margin: 0;
  color: rgba(236, 252, 247, .7);
  font-size: clamp(16px, 1.45vw, 20px);
  line-height: 1.7;
}

.feature-row {
  margin-top: 58px;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,.12);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.feature {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}

.feature-icon {
  color: var(--sn-mint);
  font: 700 10px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.feature strong,
.feature small {
  display: block;
}

.feature strong {
  margin-bottom: 5px;
  font-size: 13px;
}

.feature small {
  color: rgba(255,255,255,.52);
  font-size: 11px;
  line-height: 1.45;
}

.story-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255,255,255,.48);
  font-size: 11px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #61e1ad;
  box-shadow: 0 0 0 5px rgba(97,225,173,.09);
}

.auth-form-side {
  min-height: 100vh;
  padding: clamp(24px, 6vw, 88px);
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 80% 0, rgba(21,166,132,.08), transparent 26%),
    #f6f9f8;
}

.mobile-brand {
  display: none;
}

.auth-card {
  width: min(440px, 100%);
}

.company-logo {
  display: block;
  max-width: 150px;
  max-height: 58px;
  object-fit: contain;
  object-position: left center;
  margin: 0 0 34px;
}

.auth-heading {
  margin-bottom: 36px;
}

.auth-kicker {
  display: block;
  margin-bottom: 12px;
  color: var(--sn-teal-dark);
}

.auth-heading h2 {
  margin: 0 0 12px;
  color: var(--sn-ink);
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: -.045em;
  font-weight: 740;
}

.auth-heading p {
  margin: 0;
  color: var(--sn-muted);
  font-size: 15px;
  line-height: 1.65;
}

.field {
  margin-bottom: 22px;
}

.field label,
.field-label-row {
  font-size: 13px;
  font-weight: 700;
}

.field > label {
  display: block;
  margin-bottom: 9px;
}

.field-label-row {
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth-link {
  color: var(--sn-teal-dark);
  text-decoration: none;
  font-weight: 700;
}

.auth-link:hover {
  color: var(--sn-teal);
  text-decoration: underline;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.input-shell input {
  width: 100%;
  min-height: 56px;
  padding: 0 56px 0 48px;
  border: 1px solid var(--sn-line);
  border-radius: 14px;
  outline: none;
  color: var(--sn-ink);
  background: rgba(255,255,255,.82);
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.input-shell input::placeholder {
  color: #9aacb0;
}

.input-shell input:focus {
  border-color: var(--sn-teal);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(21,166,132,.11);
}

.input-icon {
  position: absolute;
  left: 17px;
  z-index: 1;
  display: flex;
  color: #789097;
}

.input-icon svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toggle-password {
  position: absolute;
  right: 10px;
  padding: 9px 8px;
  border: 0;
  color: var(--sn-teal-dark);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.remember-row {
  margin: -3px 0 26px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--sn-muted);
  cursor: pointer;
  font-size: 12px;
}

.remember-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--sn-teal);
}

.auth-btn {
  width: 100%;
  min-height: 57px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(110deg, #6d28d9, #8b5cf6);
  box-shadow: 0 14px 28px rgba(109,40,217,.22);
  cursor: pointer;
  font-weight: 800;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 17px 34px rgba(109,40,217,.29);
  filter: saturate(1.05);
}

.auth-btn:focus-visible {
  outline: 3px solid rgba(21,166,132,.24);
  outline-offset: 3px;
}

.auth-btn:disabled {
  cursor: wait;
  transform: none;
  opacity: .76;
}

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-btn.is-loading .btn-text {
  display: none;
}

.auth-btn.is-loading .btn-loading {
  display: inline-flex;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sn-spin .75s linear infinite;
}

@keyframes sn-spin {
  to { transform: rotate(360deg); }
}

.security-note {
  margin: 24px 0 0;
  color: #8a9da1;
  text-align: center;
  font-size: 11px;
}

.security-note span {
  margin-right: 6px;
  color: var(--sn-teal);
}

.auth-alert {
  margin: 0 0 22px;
  padding: 13px 15px;
  border: 1px solid;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.auth-alert ul {
  margin: 0;
  padding-left: 18px;
}

.auth-alert.error {
  border-color: #f0c2c2;
  color: #9f3030;
  background: #fff4f4;
}

.auth-alert.success {
  border-color: #bde3d6;
  color: var(--sn-success);
  background: #effbf7;
}

@media (max-width: 960px) {
  .safenet-auth {
    grid-template-columns: 1fr;
  }

  .auth-story {
    display: none;
  }

  .auth-form-side {
    min-height: 100svh;
    padding: 30px 22px;
    align-items: center;
  }

  .auth-card {
    padding: 32px;
    border: 1px solid rgba(220,231,228,.85);
    border-radius: 24px;
    background: rgba(255,255,255,.82);
    box-shadow: 0 24px 70px rgba(16,43,56,.09);
  }

  .mobile-brand {
    position: absolute;
    top: 26px;
    left: 26px;
    display: flex;
  }

  .mobile-brand .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    transform: scale(.86);
    transform-origin: left center;
  }
}

@media (max-width: 560px) {
  .auth-form-side {
    padding: 92px 16px 24px;
    align-items: flex-start;
  }

  .auth-card {
    padding: 28px 22px;
    border-radius: 20px;
  }

  .auth-heading {
    margin-bottom: 28px;
  }

  .auth-heading h2 {
    font-size: 31px;
  }
}

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