:root {
  --auth-bg: #f8fafc;
  --auth-surface: #ffffff;
  --auth-surface-soft: #f8fafc;
  --auth-border: #e2e8f0;
  --auth-text: #0f172a;
  --auth-text-muted: #64748b;
  --auth-brand: #0d59f2;
  --auth-brand-soft: #dbeafe;
}

.dark {
  --auth-bg: #101622;
  --auth-surface: #0f172a;
  --auth-surface-soft: #172033;
  --auth-border: #273449;
  --auth-text: #e2e8f0;
  --auth-text-muted: #94a3b8;
  --auth-brand: #4f8cff;
  --auth-brand-soft: #1e3a8a;
}

.public-auth-body {
  min-height: 100vh;
  background: var(--auth-bg);
}

.public-auth-shell {
  display: flex;
  min-height: 100vh;
}

.login-brand-section {
  display: none;
  width: 50%;
  position: relative;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .login-brand-section {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

.login-brand-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #0d59f2 0%, #1d4ed8 45%, #0f172a 100%);
}

.login-brand-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.55), rgba(13, 89, 242, 0.35));
}

.login-brand-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.login-brand-content {
  position: relative;
  z-index: 2;
  max-width: 520px;
  padding: 48px;
  color: #ffffff;
}

.login-brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 0;
  background: transparent;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo-icon .brand-logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-text {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.login-brand-title {
  font-size: 2.45rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.login-brand-desc {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.65;
}

.login-form-section {
  width: 100%;
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  background: var(--auth-bg);
}

@media (min-width: 1024px) {
  .login-form-section {
    width: 50%;
    padding: 64px;
  }
}

.login-top-actions {
  position: absolute;
  top: 20px;
  right: 20px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  z-index: 4;
}

.login-pricing-link {
  color: var(--auth-text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

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

@media (max-width: 480px) {
  .login-top-actions {
    top: 16px;
    right: 16px;
    gap: 8px;
  }

  .login-pricing-link {
    font-size: 0.8rem;
  }
}

.theme-toggle-btn {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  border: 1px solid var(--auth-border);
  background: var(--auth-surface);
  color: var(--auth-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle-btn:hover {
  color: var(--auth-text);
}

.login-mobile-logo {
  position: absolute;
  left: 24px;
  top: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--auth-text);
}

@media (min-width: 1024px) {
  .login-mobile-logo {
    display: none;
  }
}

.login-mobile-logo .logo-icon {
  width: 34px;
  height: 34px;
  color: var(--auth-text);
  background: transparent;
  border: 0;
}

.login-mobile-logo .logo-text {
  font-size: 1.2rem;
}

.login-brand-logo [data-brand-icon] .brand-logo-image,
.login-mobile-logo [data-brand-icon] .brand-logo-image {
  filter: brightness(0) invert(1) drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.login-container {
  width: 100%;
  max-width: 430px;
}

.login-header-modern h1 {
  margin: 0;
  color: var(--auth-text);
  font-size: 2.25rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.login-header-modern p {
  margin-top: 10px;
  color: var(--auth-text-muted);
}

.login-form-modern {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-field-modern label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.875rem;
  color: var(--auth-text);
  font-weight: 600;
}

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

.field-input input {
  width: 100%;
  height: 54px;
  border-radius: 10px;
  border: 1px solid var(--auth-border);
  background: var(--auth-surface);
  color: var(--auth-text);
  padding: 0 46px 0 16px;
  outline: none;
}

.field-input input::placeholder {
  color: var(--auth-text-muted);
}

.field-input input:focus {
  border-color: var(--auth-brand);
  box-shadow: 0 0 0 3px rgba(13, 89, 242, 0.15);
}

.field-icon {
  position: absolute;
  right: 14px;
  color: var(--auth-text-muted);
}

button.field-icon {
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-submit-modern {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 11px;
  background: var(--auth-brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
}

.btn-submit-modern.loading,
.btn-submit-modern:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

.magic-link-cta {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid var(--auth-border);
  background: var(--auth-surface);
  color: var(--auth-text);
  height: 46px;
  font-weight: 600;
}

.magic-link-cta:hover {
  border-color: var(--auth-brand);
  color: var(--auth-brand);
}

.error-message-modern {
  margin-top: 8px;
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #9f1239;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.875rem;
}

.dark .error-message-modern {
  border-color: #7f1d1d;
  background: #3b0a12;
  color: #fecdd3;
}

.login-footer {
  margin-top: 16px;
  text-align: center;
  color: var(--auth-text-muted);
  font-size: 0.9rem;
}

.login-signup-text {
  font-size: 0.8rem;
  color: var(--auth-text-muted);
}

.login-signup-link {
  color: var(--auth-brand) !important;
}

.login-footer a {
  color: var(--auth-brand);
  font-weight: 600;
  text-decoration: none;
}

.login-footer a:hover {
  text-decoration: underline;
}

.login-copyright {
  position: absolute;
  bottom: 18px;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  color: var(--auth-text-muted);
}

.login-copyright--left {
  left: 24px;
  width: auto;
  text-align: left;
}
