* {
  box-sizing: border-box;
}

:root {
  --fs-white: #ffffff;
  --fs-black: #0a0a0a;

  --fs-purple: #5550ff;
  --fs-purple-secondary: #908dff;
  --fs-dark-purple: #0c0020;

  --purple-90: rgba(85, 80, 255, 0.90);
  --purple-65: rgba(85, 80, 255, 0.65);
  --purple-50: rgba(85, 80, 255, 0.50);
  --purple-30: rgba(85, 80, 255, 0.30);
  --purple-10: rgba(85, 80, 255, 0.10);
  --purple-05: rgba(85, 80, 255, 0.05);

  --red: #ef4444;
  --red-10: rgba(239, 68, 68, 0.10);

  --dark-purple-10: rgba(12, 0, 32, 0.10);
  --dark-purple-05: rgba(12, 0, 32, 0.05);

  --bg: var(--app-bg);
  --surface: #ffffff;
  --surface-soft: rgba(12, 0, 32, 0.035);
  --surface-soft-2: rgba(12, 0, 32, 0.055);

  --text: #0a0a0a;
  --muted: rgba(10, 10, 10, 0.58);
  --muted-strong: rgba(10, 10, 10, 0.72);
  --border: rgba(12, 0, 32, 0.10);
  --border-medium: rgba(12, 0, 32, 0.16);

  --primary: var(--fs-purple);
  --primary-dark: #4742e8;
  --primary-soft: var(--purple-10);

  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --shadow-soft: 0 4px 14px rgba(12, 0, 32, 0.06);
  --shadow-panel: 0 10px 28px rgba(12, 0, 32, 0.10);
  --shadow-purple-soft: 0 4px 12px rgba(85, 80, 255, 0.16);
  --shadow-purple-strong: 0 8px 22px rgba(85, 80, 255, 0.24);

  --font-main: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--font-main);
  background:
    radial-gradient(circle at 18% 12%, rgba(85, 80, 255, 0.10), transparent 34%),
    radial-gradient(circle at 82% 88%, rgba(144, 141, 255, 0.10), transparent 32%),
    var(--bg);
  color: var(--text);
}

button,
input {
  font-family: inherit;
}

button {
  cursor: pointer;
}

/* PAGE */
.page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* TOPBAR */
.topbar {
  margin: 18px 24px 0;
  height: 64px;
  padding: 0 18px;

  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  box-shadow: var(--shadow-soft);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;

  border-radius: 9px;
  background: var(--fs-dark-purple);
  color: var(--fs-white);

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 12px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.brand-text {
  min-width: 0;
}

.brand-name {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.brand-subtitle {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn {
  height: var(--control-height-md);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 850;
}

/* MAIN */
.main {
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 56px 24px;
}

.login-shell {
  width: min(1000px, 100%);
  display: grid;
  grid-template-columns: 1fr 450px;
  gap: 24px;
  align-items: stretch;
}

/* PRODUCT PANEL */
.product-panel {
  padding: 38px;
  background:
    linear-gradient(145deg, rgba(85, 80, 255, 0.12), rgba(255, 255, 255, 0.92)),
    var(--app-panel-bg-solid);

  display: flex;
  flex-direction: column;
  justify-content: center;

  box-shadow: var(--app-panel-shadow-raised);
}

.eyebrow {
  width: fit-content;
  margin-bottom: 18px;
  padding: 7px 10px;

  border-radius: var(--radius-pill);
  background: var(--purple-10);
  border: 1px solid var(--purple-30);
  color: var(--primary);

  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.product-panel h1 {
  margin: 0;
  max-width: 460px;

  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -0.055em;
  font-weight: 900;
}

.lead {
  margin: 16px 0 0;
  max-width: 460px;

  font-size: 15px;
  line-height: 1.6;
  font-weight: 600;
  color: var(--muted);
}

/* CTA ROW */
.cta-row {
  margin-top: 28px;

  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.how-primary-btn,
.how-secondary-btn {
  height: 42px;
  padding: 0 17px;
  font-size: 13px;
  font-weight: 900;
}

/* LOGIN CARD */
.login-card {
  padding: 32px;
  background: var(--app-panel-bg-solid);

  box-shadow: var(--app-panel-shadow-raised);
}

.card-header h2 {
  margin: 0;

  font-size: var(--app-modal-title-size);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-page-title);
  font-weight: 900;
}

.card-header p {
  margin: 10px 0 0;

  font-size: var(--app-modal-subtitle-size);
  font-weight: 600;
  color: var(--muted);
}

/* FORM */
.login-form {
  margin-top: 28px;

  display: grid;
  gap: 15px;
}

.field span {
  font-size: 12px;
  font-weight: 850;
  color: var(--muted-strong);
}

.field input {
  height: var(--app-field-height-auth);
  font-size: 14px;
  font-weight: 600;
}

/* PASSWORD */
.password-wrap {
  position: relative;
  width: 100%;
}

.password-wrap input {
  width: 100%;
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);

  width: 32px;
  height: 32px;

  border: none;
  border-radius: 10px;
  background: transparent;

  display: flex;
  align-items: center;
  justify-content: center;

  color: var(--muted);
  font-size: 15px;
}

.password-toggle:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.eye-icon {
  line-height: 1;
  opacity: 0.8;
}

/* LOGIN BUTTON */
.login-btn {
  height: 46px;
  margin-top: 4px;
  font-size: 14px;
}

.nav-btn.app-btn:hover {
  transform: none;
}


/* LOGIN STATUS LINE */
.login-status.app-status {
  min-height: 18px;
  margin-top: -5px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;

  display: flex;
  color: var(--muted);
  text-align: center;
}

.status-indicator {
  animation: statusPulse 1.15s ease-in-out infinite;
}

.status-text {
  min-width: 0;
}

.login-status.is-error {
  color: var(--app-state-error-text);
}

.login-status.is-hidden {
  visibility: hidden;
}

.login-btn.is-loading {
  pointer-events: none;
  opacity: 0.86;
}

@keyframes statusPulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.92);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* CARD FOOTER */
.card-footer {
  margin-top: 22px;
  padding-top: 18px;

  border-top: 1px solid var(--border);

  display: flex;
  align-items: center;
  justify-content: center;

  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.footer-link-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.text-link {
  padding: 0;
  border: none;
  background: transparent;

  color: var(--text);
  font-size: inherit;
  font-weight: 900;
}

.text-link:hover {
  color: var(--primary);
}

/* FOOTER */
.footer {
  min-height: 52px;
  padding: 0 24px 18px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;

  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

/* TABLET / SMALL DESKTOP STACKED LAYOUT
   Keep both panels visible, but stack them.
   Login card goes first, marketing/product panel below. */
@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
    max-width: 520px;
    gap: 18px;
  }

  .login-card {
    order: 1;
  }

  .product-panel {
    order: 2;
    display: flex;
    min-height: auto;
    padding: 30px;
  }

  .product-panel h1 {
    max-width: none;
    font-size: 32px;
  }

  .lead {
    max-width: none;
  }

  .topbar {
    margin: 12px 12px 0;
  }

  .brand-subtitle {
    display: none;
  }

  .nav-btn {
    padding: 0 10px;
  }

  .card-footer {
    flex-direction: column;
    gap: 8px;
  }

  .footer-divider {
    display: none;
  }
}

@media (max-width: 620px) {
  .page {
    min-height: 100svh;
  }

  .topbar {
    height: auto;
    min-height: 60px;
    padding: 11px 12px;
    align-items: flex-start;
  }

  .topbar-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
  }

  .nav-btn {
    height: 34px;
    padding: 0 9px;
    font-size: 12px;
  }

  .main {
    align-items: start;
    padding: 34px 12px;
  }

  .login-card,
  .product-panel {
    padding: 24px;
  }

  .product-panel h1 {
    font-size: 28px;
  }

  .lead {
    font-size: 14px;
  }

  .card-header h2 {
    font-size: 28px;
  }

  .footer {
    padding: 0 14px 16px;
    gap: 10px 14px;
  }
}

@media (max-width: 420px) {
  .topbar {
    flex-direction: column;
    gap: 10px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-btn.primary-light {
    flex: 1;
  }

  .login-card,
  .product-panel {
    padding: 20px;
  }

  .cta-row {
    align-items: stretch;
  }

  .how-primary-btn,
  .how-secondary-btn {
    width: 100%;
  }

  .footer-link-group {
    flex-wrap: wrap;
    justify-content: center;
  }
}
