/* ==========================================================================
   GAWANGPINAS CENTRAL AUTHENTICATION PORTAL (login.gawangpinas.com)
   Form on LEFT | Rich GawangPinas Navy Brand Panel on RIGHT
   Includes Segmented Account Selector (Buyer vs Business Account)
   ========================================================================== */

/* ---------- Font Declarations ---------- */
@font-face {
  font-family: 'Helvetica Neue';
  src: url('https://gawangpinas.com/assets/fonts/HelveticaNeueRoman.otf') format('opentype'),
       url('https://gawangpinas.com/landing/assets/fonts/HelveticaNeueRoman.otf') format('opentype'),
       url('../landing/assets/fonts/HelveticaNeueRoman.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Helvetica Neue';
  src: url('https://gawangpinas.com/assets/fonts/HelveticaNeueMedium.otf') format('opentype'),
       url('https://gawangpinas.com/landing/assets/fonts/HelveticaNeueMedium.otf') format('opentype'),
       url('../landing/assets/fonts/HelveticaNeueMedium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Helvetica Neue';
  src: url('https://gawangpinas.com/assets/fonts/HelveticaNeueBold.otf') format('opentype'),
       url('https://gawangpinas.com/landing/assets/fonts/HelveticaNeueBold.otf') format('opentype'),
       url('../landing/assets/fonts/HelveticaNeueBold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Helvetica Neue';
  src: url('https://gawangpinas.com/assets/fonts/HelveticaNeueHeavy.otf') format('opentype'),
       url('https://gawangpinas.com/landing/assets/fonts/HelveticaNeueHeavy.otf') format('opentype'),
       url('../landing/assets/fonts/HelveticaNeueHeavy.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design Tokens ---------- */
:root {
  /* Brand Palette */
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-deep: #1e3a8a;
  --primary-soft: #eff6ff;
  --primary-glow: rgba(37, 99, 235, 0.25);

  /* Neutrals */
  --navy: #0f172a;
  --slate: #1e293b;
  --ink: #0f172a;
  --body: #475569;
  --muted: #94a3b8;
  --line: #e2e8f0;
  --line-soft: #f1f5f9;

  /* Accents */
  --amber: #f59e0b;
  --gold: #d97706;
  --emerald: #10b981;
  --green: #059669;
  --red: #e11d48;
  --red-soft: #fef2f2;
  --red-border: #fecaca;

  /* Surfaces */
  --bg-form: #ffffff;
  --bg-brand: #0f172a;

  /* Typography */
  --font-sans: 'Helvetica Neue', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;

  /* Border Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 48px -12px rgba(15, 23, 42, 0.12);
  --shadow-focus: 0 0 0 4px rgba(37, 99, 235, 0.15);

  /* Motion */
  --t: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--body);
  background-color: var(--bg-form);
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--t);
}
a:hover {
  color: var(--primary-dark);
}

/* ---------- Portal Layout (Form LEFT, Brand RIGHT) ---------- */
.auth-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

/* LEFT PANEL (FORM AREA) */
.auth-panel-form {
  flex: 1;
  min-width: 0;
  background-color: var(--bg-form);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 48px;
  position: relative;
}

.form-container {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

/* Brand Header */
.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-title small {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-top: 2px;
}

/* Account Type Segmented Control Tabs (Buyer vs Business) */
.account-type-tabs {
  display: flex;
  background-color: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: var(--r-md);
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  height: 40px;
  border: none;
  background: transparent;
  color: #64748b;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--t);
}

.tab-btn:hover {
  color: var(--navy);
}

.tab-btn.active {
  background-color: #ffffff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.tab-btn svg {
  transition: stroke var(--t);
}

/* Form Headings */
.auth-heading {
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.auth-subheading {
  font-size: 14px;
  color: var(--body);
  margin-bottom: 24px;
}

/* Auth Form Controls */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--navy);
  background-color: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color var(--t), box-shadow var(--t);
  appearance: none;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

.form-input::placeholder {
  color: #a0aec0;
}

/* Password Toggle Button */
.password-toggle-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted);
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--t);
}
.password-toggle-btn:hover {
  color: var(--navy);
}

/* Options Row (Remember Me & Forgot Password) */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--body);
  cursor: pointer;
  user-select: none;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  accent-color: var(--primary);
  cursor: pointer;
}

.forgot-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}
.forgot-link:hover {
  text-decoration: underline;
}

/* Primary Action Button */
.btn-submit {
  width: 100%;
  height: 48px;
  background-color: var(--primary);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
  transition: background-color var(--t), transform var(--t), box-shadow var(--t);
  margin-top: 4px;
}
.btn-submit:hover:not(:disabled) {
  background-color: var(--primary-dark);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.38);
  transform: translateY(-1px);
}
.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}
.btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  display: none;
}
.is-loading .btn-spinner {
  display: block;
}

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

/* Alert Banners */
.auth-alert {
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.auth-alert--error {
  background-color: var(--red-soft);
  border: 1px solid var(--red-border);
  color: var(--red);
}
.auth-alert--success {
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}
.auth-alert svg {
  flex-shrink: 0;
  margin-top: 2px;
}

/* Form Divider */
.form-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--line);
}

/* Registration Prompt */
.register-prompt {
  text-align: center;
  font-size: 14px;
  color: var(--body);
}
.register-link {
  font-weight: 700;
  color: var(--primary);
  margin-left: 4px;
}
.register-link:hover {
  text-decoration: underline;
}

/* Footnote */
.auth-domain-note {
  margin-top: 36px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* RIGHT PANEL (GAWANGPINAS RICH NAVY BRAND PANEL) */
.auth-panel-brand {
  flex: 1;
  min-width: 0;
  background: radial-gradient(circle at 85% 20%, #1e3a8a 0%, #0f172a 90%);
  color: #ffffff;
  padding: 56px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.auth-panel-brand::before {
  content: '';
  position: absolute;
  top: -120px;
  left: -120px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.28) 0%, rgba(15, 23, 42, 0) 70%);
  pointer-events: none;
}

.brand-inner {
  width: 100%;
  max-width: 480px;
  margin: auto;
  z-index: 2;
}

.gov-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e2e8f0;
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
}

.gov-badge svg {
  color: var(--amber);
}

.brand-heading {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.15;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.brand-heading span {
  color: #60a5fa;
}

.brand-subtext {
  font-size: 16px;
  line-height: 1.65;
  color: #cbd5e1;
  margin-bottom: 36px;
}

.brand-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-md);
  transition: transform var(--t), background var(--t);
}
.feature-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.feature-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.25);
  border: 1px solid rgba(96, 165, 250, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60a5fa;
  flex-shrink: 0;
}

.feature-text h4 {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
}

.feature-text p {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
}

.brand-footer {
  font-size: 13px;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
  z-index: 2;
  margin-top: 40px;
}

/* ---------- Password Strength Checklist ---------- */
.strength-meter {
  margin-top: 6px;
}
.strength-bar {
  height: 4px;
  background-color: var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}
.strength-fill {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease, background-color 0.3s ease;
}
.strength-rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  font-size: 12px;
  color: var(--muted);
}
.rule-item.valid {
  color: var(--green);
  font-weight: 600;
}

/* ---------- RESPONSIVE BREAKPOINTS ---------- */
@media (max-width: 960px) {
  .auth-wrapper {
    flex-direction: column;
  }
  .auth-panel-brand {
    display: none; /* Hide side panel on mobile/tablet */
  }
  .auth-panel-form {
    width: 100%;
    min-height: 100vh;
    padding: 40px 24px;
  }
}

@media (min-width: 1400px) {
  .form-container {
    max-width: 460px;
  }
  .brand-inner {
    max-width: 520px;
  }
}
