/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Design Tokens (matching portal design system) ── */
:root {
  --pmc-burgundy: #A91B43;
  --pmc-burgundy-dark: #8A1536;
  --pmc-burgundy-light: rgba(169, 27, 67, 0.08);
  --pmc-burgundy-muted: rgba(169, 27, 67, 0.15);
  --pmc-burgundy-glow: rgba(169, 27, 67, 0.2);
  --gov-strip-gradient: linear-gradient(90deg, #FF6B35 0%, #FFFFFF 33%, #138808 100%);
  --header-height: 72px;
  --font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.1);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: linear-gradient(
    180deg,
    var(--landing-page-bg-start, #fafbfc) 0%,
    var(--landing-page-bg-mid, #f1f5f9) 50%,
    var(--landing-page-bg-end, #e2e8f0) 100%
  );
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--landing-page-text, #0f172a);
  -webkit-font-smoothing: antialiased;
}

/* ── Gov Strip ── */
.gov-strip {
  height: 4px;
  background: var(--gov-strip-gradient);
  flex-shrink: 0;
}

/* ── Header ── */
.header {
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.header-logo-img {
  height: 44px;
  width: auto;
}

.header-brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.header-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--pmc-burgundy);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.header-subtitle {
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.2;
}

.header-spacer {
  flex: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.locale-toggle-btn {
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--pmc-burgundy);
  background: transparent;
  border: 1px solid var(--pmc-burgundy);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.locale-toggle-btn:hover {
  background: var(--pmc-burgundy-light);
  color: var(--pmc-burgundy-dark);
}

.login-dropdown.is-open .locale-toggle-btn {
  background: var(--pmc-burgundy-light);
  color: var(--pmc-burgundy-dark);
  border-color: var(--pmc-burgundy);
  box-shadow: inset 0 0 0 1px rgba(169, 27, 67, 0.22);
}

.header-login-btn {
  padding: 0.625rem 1.5rem;
  background: var(--pmc-burgundy);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.header-login-btn:hover {
  background: var(--pmc-burgundy-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(169, 27, 67, 0.25);
}

/* ── Auth mode toggle (landing login) ── */
.auth-mode-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.auth-mode-btn {
  flex: 1;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: transparent;
  color: #0f172a;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.auth-mode-btn[aria-selected="true"] {
  background: var(--pmc-burgundy);
  border-color: var(--pmc-burgundy);
  color: #fff;
}

.auth-mode-btn:hover {
  background: var(--pmc-burgundy-light);
  border-color: rgba(169, 27, 67, 0.35);
  color: var(--pmc-burgundy-dark);
}

/* ── Login dropdown (landing) ── */
.login-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.login-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 0.5rem;
  display: none;
  z-index: 200;
}

/* Hard guard: keep dropdown menu hidden until interaction */
.header .login-dropdown .login-dropdown-menu {
  display: none;
}

.login-dropdown-item {
  display: block;
  padding: 0.625rem 0.75rem;
  border-radius: 10px;
  color: #0f172a;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.login-dropdown-item:hover,
.login-dropdown-item:focus {
  background: var(--pmc-burgundy-light);
  color: var(--pmc-burgundy-dark);
  outline: none;
}

.header .login-dropdown.is-open .login-dropdown-menu {
  display: block;
}

/* ── Hero Section ── */
.hero {
  position: relative;
  background: linear-gradient(
    145deg,
    var(--pmc-burgundy) 0%,
    var(--landing-hero-mid, #7d1a3d) 40%,
    var(--pmc-burgundy-dark) 100%
  );
  padding: 5rem 1.5rem 6rem;
  text-align: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.hero-bg-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image: radial-gradient(circle at 2px 2px, white 1.5px, transparent 0);
  background-size: 40px 40px;
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 1.25rem;
  line-height: 1.12;
  letter-spacing: -0.035em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.hero-description {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

/* ── Hero CTA Buttons ── */
.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.2s ease;
}

.hero-cta-primary {
  background: #fff;
  color: var(--pmc-burgundy);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.hero-cta-primary:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.hero-cta-secondary {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.hero-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.9);
  color: #fff;
}

/* ── Main Content ── */
.main-content {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 2.5rem 1rem;
}

/* ── Auth Card (Login) ── */
.auth-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  height: fit-content;
  border: 1px solid rgba(226, 232, 240, 0.8);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--pmc-burgundy) 0%, var(--pmc-burgundy-dark) 100%);
}

.auth-card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.auth-card-subtitle {
  font-size: 0.9375rem;
  color: #64748b;
  line-height: 1.5;
}

.auth-card-footer {
  margin: 1.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  font-size: 0.875rem;
  color: #64748b;
}
.auth-card-footer-link {
  color: var(--pmc-burgundy);
  text-decoration: none;
  font-weight: 500;
  margin-left: 0.25rem;
}
.auth-card-footer-link:hover {
  text-decoration: underline;
}

/* ── Form ── */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.5rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
}

.form-group input:hover {
  border-color: #cbd5e1;
}

.form-group input:focus {
  border-color: var(--pmc-burgundy);
  box-shadow: 0 0 0 3px var(--pmc-burgundy-light);
  background: #fff;
}

.form-group input.error {
  border-color: #dc2626;
  background: #fef2f2;
}

.field-error {
  display: block;
  font-size: 0.8125rem;
  color: #dc2626;
  margin-top: 0.25rem;
  min-height: 1.2em;
}

.field-hint {
  display: block;
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.25rem;
}

.required {
  color: #dc2626;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-group-checkbox {
  margin-bottom: 1rem;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 500;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin-top: 0.2rem;
  cursor: pointer;
}

.auth-card.auth-card-register {
  max-width: 520px;
}

/* ── Password visibility toggle ── */
.auth-forgot-wrap {
  margin-top: 0.25rem;
  margin-bottom: 0;
  text-align: right;
}
.auth-forgot-link {
  font-size: 0.8125rem;
  color: var(--pmc-burgundy, #800020);
  text-decoration: none;
  font-weight: 500;
}
.auth-forgot-link:hover {
  text-decoration: underline;
}

.auth-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-password-wrap input {
  padding-right: 2.75rem;
}

/* Edge adds a built-in password reveal/clear control; hide it
   so only the custom eye toggle is shown consistently. */
.auth-password-wrap input[type="password"]::-ms-reveal,
.auth-password-wrap input[type="password"]::-ms-clear {
  display: none;
}

.auth-password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  color: #6b7280;
  cursor: pointer;
  transition: color 0.15s;
}

.auth-password-toggle:hover {
  color: var(--pmc-burgundy);
}

.auth-password-toggle:focus {
  outline: none;
}

.password-icon-hidden {
  display: none;
}

.auth-password-wrap.is-visible .password-icon:first-of-type {
  display: none;
}

.auth-password-wrap.is-visible .password-icon-hidden {
  display: block;
}

/* ── Alerts ── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.alert-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.alert-info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.alert-success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

/* ── Button ── */
.btn {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background-color 0.15s;
  margin-top: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--pmc-burgundy) 0%, var(--pmc-burgundy-dark) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(169, 27, 67, 0.25);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #b81f4a 0%, var(--pmc-burgundy) 100%);
  box-shadow: 0 4px 16px rgba(169, 27, 67, 0.3);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-secondary {
  background: #fff;
  color: var(--pmc-burgundy);
  border: 2px solid var(--pmc-burgundy);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  margin-top: 0.75rem;
}

.btn-secondary:hover {
  background: var(--pmc-burgundy-light);
}

.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.identifier-send-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.identifier-send-row input {
  flex: 1;
  min-width: 0;
}

.btn-inline {
  width: auto;
  min-width: 6rem;
  margin-top: 0;
  flex-shrink: 0;
}

.auth-card-footer .btn-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-size: inherit;
  color: var(--pmc-burgundy);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
}

.auth-card-footer .btn-link:hover {
  text-decoration: none;
}

/* ── OTP digit boxes ── */
.otp-boxes {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 0.5rem 0 0;
}

.otp-box {
  width: 2.75rem;
  height: 2.75rem;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-sm);
  background: #fff;
  color: #0f172a;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.otp-box:focus {
  outline: none;
  border-color: var(--pmc-burgundy);
  box-shadow: 0 0 0 3px var(--pmc-burgundy-light);
}

.otp-box.error {
  border-color: #dc2626;
}

.otp-section-wrap {
  margin-top: 0.25rem;
}

.otp-expiry-text {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.otp-expiry-text.expired {
  color: #dc2626;
}

.password-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

/* ── Spinner ── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  gap: 0.75rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.divider span {
  font-size: 0.8125rem;
  color: #9ca3af;
  white-space: nowrap;
}

/* ── Portal Links ── */
.portal-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.portal-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  text-decoration: none;
  color: #374151;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: border-color 0.15s, background-color 0.15s;
}

.portal-link:hover {
  border-color: var(--pmc-burgundy);
  background: #fef2f6;
  color: var(--pmc-burgundy);
}

.portal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #f3f4f6;
  border-radius: 6px;
  flex-shrink: 0;
}

.portal-link:hover .portal-icon {
  background: var(--pmc-burgundy-light);
}

/* ── Features Section ── */
.features {
  padding: 4rem 1.5rem 5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.features-header {
  text-align: center;
  margin-bottom: 3rem;
}

.features-title {
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.features-subtitle {
  font-size: 1.0625rem;
  color: #64748b;
  max-width: 480px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.feature-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem 1.75rem;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
  border: 1px solid var(--landing-card-border, rgba(226, 232, 240, 0.8));
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--pmc-burgundy-muted);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--pmc-burgundy-light) 0%, var(--pmc-burgundy-muted) 100%);
  color: var(--pmc-burgundy);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  transition: transform 0.25s ease;
}

.feature-card:hover .feature-icon {
  transform: scale(1.05);
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.feature-description {
  font-size: 0.9375rem;
  color: #64748b;
  line-height: 1.65;
}

/* ── Footer ── */
.footer {
  background: linear-gradient(180deg, var(--pmc-burgundy-dark) 0%, var(--landing-footer-dark, #5c0d28) 100%);
  padding: 1.5rem 1.5rem;
  flex-shrink: 0;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-text {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.85);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 0 1rem;
  }

  .header-subtitle {
    display: none;
  }

  .header-logo-img {
    height: 38px;
  }

  .hero {
    padding: 3rem 1rem 4rem;
  }

  .hero-badge {
    font-size: 0.8125rem;
  }

  .hero-title {
    font-size: 1.875rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-cta {
    width: 100%;
  }

  .main-content {
    padding: 1.5rem 1rem;
  }

  .auth-card {
    padding: 1.5rem;
  }

  .features {
    padding: 3rem 1rem 4rem;
  }

  .features-title {
    font-size: 1.5rem;
  }

  .features-header {
    margin-bottom: 2rem;
  }
}
