/**
 * ePartner — public / marketing / auth (quiet premium, matches erp-premium tone)
 * Scope: body.erp-guest
 */
body.erp-guest {
  --guest-font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --guest-ink: #18181b;
  --guest-text: #3f3f46;
  --guest-muted: #71717a;
  --guest-border: #e4e4e7;
  --guest-surface: #ffffff;
  --guest-bg: #f4f4f5;
  --guest-elevated: #fafafa;
  --guest-primary: #2563eb;
  --guest-primary-hover: #1e40af;
  margin: 0;
  padding: 0;
  font-family: var(--guest-font);
  color: var(--guest-ink);
  background: var(--guest-surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.erp-guest * {
  box-sizing: border-box;
}

body.erp-guest html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body.erp-guest .container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  width: 100%;
}

body.erp-guest .container-limited {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

body.erp-guest .nav-wrapper {
  width: 100%;
  background: var(--guest-surface) !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 9999 !important;
  border-bottom: 1px solid var(--guest-border);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

body.erp-guest .nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  max-width: 100%;
  margin: 0 auto;
  width: 100%;
}

body.erp-guest .nav-brand-row {
  display: flex;
  align-items: center;
  flex: 1;
}

body.erp-guest .nav a {
  margin: 0 10px;
  text-decoration: none;
  color: var(--guest-ink);
  font-weight: 600;
  font-size: 0.9375rem;
}

body.erp-guest .nav a:hover {
  color: var(--guest-muted);
}

body.erp-guest .nav a.logo {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--guest-ink);
  letter-spacing: -0.03em;
}

body.erp-guest .btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body.erp-guest .btn-primary {
  background: var(--guest-primary);
  color: #fff;
  border-color: var(--guest-primary);
}

body.erp-guest .btn-primary:hover {
  background: var(--guest-primary-hover);
  border-color: var(--guest-primary-hover);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

body.erp-guest .btn-secondary {
  background: var(--guest-elevated);
  color: var(--guest-ink);
  border-color: var(--guest-border);
}

body.erp-guest .btn-secondary:hover {
  background: var(--guest-bg);
  border-color: #d4d4d8;
}

body.erp-guest .nav-buttons .btn-primary {
  margin-left: 8px;
}

body.erp-guest .hero {
  padding: 60px 0;
}

body.erp-guest .hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin: 0 0 10px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--guest-ink);
}

body.erp-guest .hero p {
  color: var(--guest-muted);
  font-size: 1.0625rem;
  margin: 0 0 20px;
  max-width: 40rem;
}

body.erp-guest .grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

body.erp-guest .card {
  border: 1px solid var(--guest-border);
  border-radius: 12px;
  padding: 20px;
  background: var(--guest-surface);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

body.erp-guest .footer {
  margin-top: 40px;
  padding: 60px 20px;
  background: var(--guest-ink);
  color: #a1a1aa;
  width: 100%;
}

body.erp-guest .footer h3,
body.erp-guest .footer h4 {
  color: #fafafa;
}

body.erp-guest .footer a {
  color: #a1a1aa;
  text-decoration: none;
  transition: color 0.15s ease;
}

body.erp-guest .footer a:hover {
  color: #e4e4e7;
}

body.erp-guest .footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

body.erp-guest .footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

body.erp-guest .footer li {
  margin-bottom: 10px;
}

body.erp-guest .footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid #3f3f46;
  color: #71717a;
  font-size: 0.875rem;
}

@media (max-width: 900px) {
  body.erp-guest .grid {
    grid-template-columns: 1fr;
  }
}

/* Burger / mobile */
body.erp-guest .burger-menu {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 8px;
  gap: 5px;
  z-index: 10000;
}

body.erp-guest .burger-menu span {
  width: 22px;
  height: 2px;
  background: var(--guest-ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

body.erp-guest .burger-menu.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

body.erp-guest .burger-menu.active span:nth-child(2) {
  opacity: 0;
}

body.erp-guest .burger-menu.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

body.erp-guest .mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--guest-surface);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 80px 20px 20px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-100%);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.06);
}

body.erp-guest .mobile-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

body.erp-guest .mobile-menu a:not(.mobile-btn) {
  color: var(--guest-ink);
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
  margin: 12px 0;
  padding: 10px 20px;
  border-bottom: 1px solid transparent;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.35s ease, transform 0.35s ease, color 0.15s ease;
}

body.erp-guest .mobile-menu.active a:not(.mobile-btn) {
  opacity: 1;
  transform: translateY(0);
}

body.erp-guest .mobile-menu a:not(.mobile-btn):hover {
  color: var(--guest-muted);
}

body.erp-guest .mobile-menu .mobile-btn {
  background: var(--guest-primary);
  color: #fff;
  margin-top: 16px;
  font-weight: 600;
  border: 1px solid var(--guest-primary);
  padding: 14px 28px;
  border-radius: 8px;
  text-align: center;
  width: 100%;
  max-width: 280px;
  text-decoration: none;
  display: block;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease, background 0.15s ease, border-color 0.15s ease;
}

body.erp-guest .mobile-menu.active .mobile-btn {
  opacity: 1;
  transform: translateY(0);
}

body.erp-guest .mobile-menu .mobile-btn:hover {
  background: var(--guest-primary-hover);
  border-color: var(--guest-primary-hover);
}

body.erp-guest .mobile-menu .mobile-btn.btn-secondary {
  background: var(--guest-elevated);
  color: var(--guest-ink);
  border-color: var(--guest-border);
}

body.erp-guest .mobile-menu .mobile-btn.btn-secondary:hover {
  background: var(--guest-bg);
}

body.erp-guest .mobile-menu-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--guest-ink);
  font-size: 2rem;
  cursor: pointer;
  padding: 10px;
  line-height: 1;
  z-index: 10001;
  font-weight: 300;
  opacity: 0;
  transform: rotate(90deg);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

body.erp-guest .mobile-menu.active .mobile-menu-close {
  opacity: 1;
  transform: rotate(0deg);
}

body.erp-guest .nav-link {
  display: inline-block;
}

body.erp-guest .nav-buttons {
  display: flex;
  align-items: center;
}

@media (max-width: 768px) {
  body.erp-guest .nav-link {
    display: none !important;
  }
  body.erp-guest .nav-buttons {
    display: none !important;
  }
  body.erp-guest .burger-menu {
    display: flex !important;
  }
  body.erp-guest .nav {
    justify-content: space-between;
    padding: 12px 20px;
    align-items: center;
    width: 100%;
  }
  body.erp-guest .nav-brand-row {
    display: flex !important;
    align-items: center;
    flex: 0 0 auto;
  }
  body.erp-guest .nav .logo {
    display: block !important;
    margin: 0 !important;
    font-size: 1rem !important;
  }
  body.erp-guest .nav-brand-row a:not(.logo) {
    display: none !important;
  }
}

/* Login page */
body.erp-guest .erp-guest-hero {
  background: var(--guest-elevated);
  border-bottom: 1px solid var(--guest-border);
  color: var(--guest-ink);
  padding: 4.5rem 0 3.5rem;
  text-align: center;
  position: relative;
}

body.erp-guest .erp-guest-hero--compact {
  padding: 3.5rem 0 2.5rem;
}

body.erp-guest .erp-guest-hero .hero-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

body.erp-guest .erp-guest-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--guest-ink);
}

body.erp-guest .erp-guest-hero p {
  font-size: 1rem;
  margin: 0 auto;
  color: var(--guest-muted);
  line-height: 1.6;
  max-width: 32rem;
}

body.erp-guest .login-section {
  padding: 4rem 0 5rem;
  background: var(--guest-bg);
  width: 100%;
}

body.erp-guest .section-container {
  max-width: 440px;
  margin: 0 auto;
  padding: 0 20px;
}

body.erp-guest .section-container--wide {
  max-width: 720px;
}

body.erp-guest .login-form-wrapper {
  background: var(--guest-surface);
  padding: 2.25rem 2rem;
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  border: 1px solid var(--guest-border);
}

body.erp-guest .login-form-wrapper .form-group {
  margin-bottom: 1.25rem;
}

body.erp-guest .login-form-wrapper .form-group label {
  display: block;
  font-weight: 600;
  color: var(--guest-ink);
  margin-bottom: 0.35rem;
  font-size: 0.8125rem;
}

body.erp-guest .login-form-wrapper .form-group input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--guest-border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  background: var(--guest-surface);
  color: var(--guest-ink);
}

body.erp-guest .login-form-wrapper .form-group input:focus {
  outline: none;
  border-color: #a1a1aa;
  box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.06);
}

body.erp-guest .remember {
  display: flex;
  align-items: center;
  margin-bottom: 1.25rem;
}

body.erp-guest .remember input {
  margin-right: 8px;
  cursor: pointer;
  width: 18px;
  height: 18px;
}

body.erp-guest .remember label {
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--guest-text);
  margin: 0;
  font-weight: 500;
}

body.erp-guest .error-message {
  color: #991b1b;
  font-size: 0.8125rem;
  margin-top: 0.35rem;
  display: block;
}

body.erp-guest .login-form-wrapper .alert {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  border: 1px solid var(--guest-border);
}

body.erp-guest .login-form-wrapper .alert-danger {
  background: #fafafa;
  border-color: #fecaca;
  color: #991b1b;
}

body.erp-guest .login-form-wrapper .alert-success {
  background: #fafafa;
  border-color: #bbf7d0;
  color: #166534;
}

body.erp-guest .login-form-wrapper .alert ul {
  margin: 0;
  padding-left: 1.25rem;
}

body.erp-guest .btn-submit {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--guest-primary);
  color: #fff;
  border: 1px solid var(--guest-primary);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  margin-top: 0.25rem;
}

body.erp-guest .btn-submit:hover {
  background: var(--guest-primary-hover);
  border-color: var(--guest-primary-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

body.erp-guest .login-links {
  text-align: center;
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

body.erp-guest .login-links a {
  color: var(--guest-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
}

body.erp-guest .login-links a:hover {
  color: var(--guest-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.erp-guest .register-link {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--guest-muted);
  font-size: 0.875rem;
}

body.erp-guest .register-link a {
  color: var(--guest-ink);
  text-decoration: none;
  font-weight: 600;
}

body.erp-guest .register-link a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Register (shared form shell) */
body.erp-guest .login-form-wrapper .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

body.erp-guest .login-form-wrapper label .required {
  color: #991b1b;
  font-weight: 700;
}

body.erp-guest .terms-link {
  margin: 1rem 0 1.25rem;
  font-size: 0.8125rem;
  color: var(--guest-muted);
  text-align: center;
  line-height: 1.5;
}

body.erp-guest .terms-link a {
  color: var(--guest-ink);
  font-weight: 600;
  text-decoration: none;
}

body.erp-guest .terms-link a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.erp-guest .login-link {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--guest-muted);
  font-size: 0.875rem;
}

body.erp-guest .login-link a {
  color: var(--guest-ink);
  font-weight: 600;
  text-decoration: none;
}

body.erp-guest .login-link a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 768px) {
  body.erp-guest .login-form-wrapper .form-row {
    grid-template-columns: 1fr;
  }
  body.erp-guest .login-section {
    padding: 2.5rem 0 3rem;
  }
  body.erp-guest .login-form-wrapper {
    padding: 1.5rem 1.25rem;
  }
  body.erp-guest .erp-guest-hero {
    padding: 3rem 0 2rem;
  }
}

/* Shared with dashboard overlay */
.erp-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(250, 250, 250, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  backdrop-filter: blur(2px);
}

.erp-loading-overlay.is-visible {
  display: flex;
}

.erp-loading-spinner {
  width: 40px;
  height: 40px;
  border: 2px solid #e4e4e7;
  border-top-color: #18181b;
  border-radius: 50%;
  animation: erp-guest-spin 0.7s linear infinite;
}

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