:root {
  --login-brand-50: #e8f7fb;
  --login-brand-100: #d4eef5;
  --login-brand-400: #2a9fc0;
  --login-brand-500: #1f7f9b;
  --login-brand-600: #15677e;
  --login-bg: #f8fbfd;
  --login-surface: #ffffff;
  --login-heading: #14213d;
  --login-text: #111827;
  --login-muted: #6b7280;
  --login-border: rgba(17, 24, 39, 0.08);
  --login-brand-border: rgba(42, 159, 192, 0.28);
  --login-shadow: 0 24px 70px rgba(17, 24, 39, 0.09);
  --login-button-shadow: 0 12px 28px rgba(42, 159, 192, 0.24);
}

html {
  min-height: 100%;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: var(--login-bg);
}

body {
  min-height: 100vh;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  color: var(--login-text);
  background: var(--login-bg);
  font-family: "Inter", system-ui, sans-serif;
}

.auth-page {
  position: relative;
  display: block;
  min-height: 100vh;
  padding: 32px 56px 42px;
  overflow-x: hidden;
  overflow-y: auto;
  background: linear-gradient(180deg, #fbfdff 0%, #f8fbfd 56%, #f3f8fb 100%);
}

.auth-page::before {
  display: none;
}

.login-brand {
  position: relative;
  z-index: 2;
}

.login-brand a,
.auth-mobile-logo a {
  display: inline-flex;
  align-items: center;
}

.login-brand img {
  width: 212px;
  height: auto;
  display: block;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  min-height: calc(100vh - 118px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 440px);
  align-items: center;
  gap: 54px;
  margin: 0 auto;
  padding: 30px 0 18px;
}

.login-hero {
  max-width: 590px;
}

.login-eyebrow,
.auth-form-eyebrow {
  margin: 0 0 12px;
  color: var(--login-brand-500);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-hero h1 {
  margin: 0;
  color: var(--login-heading);
  font-family: var(--font-body, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  font-size: clamp(48px, 5vw, 72px);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.02;
  overflow-wrap: break-word;
}

.login-lead {
  max-width: 560px;
  margin: 20px 0 0;
  color: var(--login-muted);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.55;
}

.login-ai-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 18px;
  margin-top: 34px;
  padding: 22px;
  border: 1px solid rgba(42, 159, 192, 0.2);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 50px rgba(17, 24, 39, 0.06);
  backdrop-filter: blur(14px);
}

.login-ai-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  color: var(--login-brand-500);
  background: var(--login-brand-50);
}

.login-ai-icon svg {
  width: 30px;
  height: 30px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-ai-card h2 {
  margin: 0;
  color: var(--login-heading);
  font-size: 19px;
  font-weight: 850;
  line-height: 1.22;
}

.login-ai-card p {
  margin: 8px 0 0;
  color: var(--login-muted);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.login-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.login-feature-grid span {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid rgba(42, 159, 192, 0.16);
  border-radius: 16px;
  color: var(--login-heading);
  background: rgba(232, 247, 251, 0.46);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.auth-right {
  display: block;
  width: 100%;
  min-height: auto;
  padding: 0;
  background: transparent;
}

.auth-form-box {
  width: 100%;
  max-width: none;
  min-height: auto;
  display: block;
  padding: 36px;
  border: 1px solid var(--login-border);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--login-shadow);
  backdrop-filter: blur(16px);
}

.auth-form-box h2 {
  margin: 0;
  padding: 0;
  color: var(--login-heading);
  font-family: var(--font-body, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  font-size: 42px;
  font-weight: 500;
  line-height: 1.05;
  text-align: left;
}

.auth-form-copy {
  margin: 12px 0 24px;
  color: var(--login-muted);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.auth-message {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.auth-message.error {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fef2f2;
}

.auth-message.success {
  border-color: rgba(42, 159, 192, 0.24);
  color: var(--login-brand-600);
  background: var(--login-brand-50);
}

.auth-row {
  margin: 0 0 18px;
}

.auth-row label {
  display: block;
  margin: 0 0 8px;
  color: #40516a;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.auth-row input[type="text"],
.auth-row input[type="email"],
.auth-row input[type="password"] {
  width: 100%;
  min-height: 52px;
  display: block;
  margin: 0;
  padding: 0 16px;
  border: 1px solid var(--login-border);
  border-radius: 16px;
  color: var(--login-text);
  background: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: none;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-row input::placeholder {
  color: #9ca3af;
}

.auth-row input:focus {
  background: #ffffff;
}

.password-wrap input {
  padding-right: 52px !important;
}

.password-toggle {
  right: 10px;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  color: var(--login-muted);
  background: transparent;
  transition: color 160ms ease, background 160ms ease;
}

.password-toggle:hover {
  color: var(--login-brand-600);
  background: var(--login-brand-50);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

.auth-remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 0;
}

.auth-remember-row label,
.auth-remember-row a {
  color: var(--login-muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.auth-remember-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.auth-remember-row a {
  color: var(--login-brand-600);
}

.auth-remember-row a:hover {
  color: var(--login-brand-700, #0f4f61);
}

.auth-remember-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--login-brand-500);
}

.auth-btn {
  width: 100%;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 26px 0 0;
  padding: 0 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(180deg, var(--login-brand-500), var(--login-brand-600));
  box-shadow: var(--login-button-shadow);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.auth-btn:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, var(--login-brand-400), var(--login-brand-600));
  transform: translateY(-1px);
}

.auth-btn:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
}

.auth-spinner {
  margin-right: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px;
  color: var(--login-muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1 1 auto;
  background: rgba(17, 24, 39, 0.08);
}

.auth-link-btn {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 20px;
  border: 1px solid var(--login-brand-border);
  border-radius: 999px;
  color: var(--login-brand-600);
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.04);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.auth-link-btn:hover {
  color: var(--login-brand-600);
  border-color: rgba(42, 159, 192, 0.42);
  background: var(--login-brand-50);
}

.auth-center-link {
  color: var(--login-brand-600);
}

.auth-mobile-logo {
  display: none;
}

@media (max-width: 980px) {
  .auth-page {
    padding: 28px 24px 36px;
  }

  .login-shell {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 42px 0 0;
  }

  .login-hero {
    max-width: 720px;
  }

  .login-hero h1 {
    font-size: clamp(42px, 9vw, 62px);
  }

  .auth-right {
    width: 100%;
    padding: 0;
    min-height: auto;
  }
}

@media (max-width: 640px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
  }

  .auth-page {
    width: 100%;
    max-width: 100vw;
    padding: 24px 18px 28px;
  }

  .login-brand img {
    width: 184px;
  }

  .login-shell {
    width: min(354px, 100%);
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-top: 28px;
  }

  .login-hero,
  .auth-right,
  .auth-form-box,
  .login-ai-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .login-shell * {
    max-width: 100%;
  }

  .login-hero h1 {
    font-size: 40px;
  }

  .login-lead {
    font-size: 16px;
    overflow-wrap: anywhere;
    white-space: normal !important;
    word-break: break-word;
  }

  .login-ai-card {
    margin-top: 24px;
    padding: 18px;
  }

  .login-ai-card {
    grid-template-columns: 1fr;
  }

  .login-feature-grid {
    display: none;
  }

  .login-ai-card p,
  .auth-form-copy {
    overflow-wrap: anywhere;
    white-space: normal !important;
    word-break: break-word;
  }

  .auth-form-box {
    padding: 28px 22px;
    border-radius: 24px;
  }

  .auth-form-box h2 {
    font-size: 38px;
  }

  .auth-remember-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}

/* ---- OAuth provider buttons (Google / Microsoft) ----
   Stack below the "Eller fortsæt med" divider on the login screen. Match
   the .auth-link-btn footprint (same padding + border-radius) so the three
   buttons read as a single group, but with the provider logo on the left
   instead of a single text label. */
.auth-oauth-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: -10px; /* mirror .auth-link-btn's pull-up */
}

.auth-oauth-btn {
  width: 100%;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #d9dde4;
  border-radius: 999px;
  background: #ffffff;
  color: #1f2937;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.05s;
}

.auth-oauth-btn:hover {
  background: #f8fafc;
  border-color: #00506a;
}

.auth-oauth-btn:active {
  transform: translateY(1px);
}

.auth-oauth-btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(0, 80, 106, 0.22);
}

.auth-oauth-btn:disabled,
.auth-oauth-btn.is-loading {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-oauth-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-oauth-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.auth-oauth-label {
  flex: 0 1 auto;
  text-align: left;
  white-space: nowrap;
}

/* Tiny spinner shown while the provider redirect is being negotiated.
   We don't get a great callback for "I clicked but nothing happened yet",
   so we just dim the button via .is-loading — a full spinner would feel
   heavier than the brief 100-300ms window before the browser navigates. */
