/* ==========================================================================
   FAREGRAM AUTHENTICATION EXPERIENCE (FaregramAuthShell & Symmetrical Forms)
   WCAG 2.2 AA Compliant, Mobile-First, App-Like Design System
   ========================================================================== */

:root {
  --fg-auth-primary: #0b4d9c;
  --fg-auth-primary-hover: #083b78;
  --fg-auth-primary-focus: rgba(11, 77, 156, 0.25);
  --fg-auth-surface: #ffffff;
  --fg-auth-bg: #f8fafc;
  --fg-auth-border: #e2e8f0;
  --fg-auth-border-focus: #0b4d9c;
  --fg-auth-text: #0f172a;
  --fg-auth-muted: #64748b;
  --fg-auth-radius-card: 22px;
  --fg-auth-radius-field: 13px;
  --fg-auth-field-height: 56px;
}

body.fg-auth-page {
  background-color: var(--fg-auth-bg);
  color: var(--fg-auth-text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Ensure floating WhatsApp does not overlap auth forms */
body.fg-auth-page .faregram-whatsapp-fab {
  display: none !important;
}

/* 1. Compact Public Header */
.fg-auth-header {
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid var(--fg-auth-border);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 40;
}

.fg-auth-header-inner {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fg-auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-auth-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 150ms ease;
  min-height: 44px;
  min-width: 44px;
}

.fg-auth-back-link:hover,
.fg-auth-back-link:focus-visible {
  color: var(--fg-auth-primary);
  background: #f1f5f9;
  outline: 2px solid var(--fg-auth-primary);
  outline-offset: 1px;
}

.fg-auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--fg-auth-primary);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.fg-auth-help-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--fg-auth-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 150ms ease;
  min-height: 44px;
}

.fg-auth-help-link:hover,
.fg-auth-help-link:focus-visible {
  color: var(--fg-auth-primary);
  background: #f1f5f9;
  outline: 2px solid var(--fg-auth-primary);
  outline-offset: 1px;
}

/* 2. Main Auth Stage */
.fg-auth-stage {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  width: 100%;
}

.fg-auth-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* Symmetrical Auth Card */
.fg-auth-card {
  background: var(--fg-auth-surface);
  border: 1px solid var(--fg-auth-border);
  border-radius: var(--fg-auth-radius-card);
  padding: 28px 24px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

@media (min-width: 640px) {
  .fg-auth-card {
    padding: 36px 32px;
  }
}

/* Header & Typography Rhythm */
.fg-auth-card-header {
  margin-bottom: 24px;
  text-align: center;
}

.fg-auth-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--fg-auth-text);
  margin: 0 0 8px 0;
  letter-spacing: -0.015em;
}

.fg-auth-subtitle {
  font-size: 14px;
  color: var(--fg-auth-muted);
  line-height: 1.5;
  margin: 0;
}

/* Portal Role Selector Tabs (Personal vs B2B vs Team) */
.fg-auth-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 24px;
  gap: 4px;
}

.fg-auth-tab {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--fg-auth-muted);
  text-decoration: none;
  transition: all 150ms ease;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fg-auth-tab:hover {
  color: var(--fg-auth-text);
}

.fg-auth-tab.active {
  background: #ffffff;
  color: var(--fg-auth-primary);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

/* Status / Alert feedback */
.fg-auth-alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.fg-auth-alert-danger {
  background-color: #fef2f2;
  border: 1px solid #fee2e2;
  color: #991b1b;
}

.fg-auth-alert-success {
  background-color: #f0fdf4;
  border: 1px solid #dcfce7;
  color: #166534;
}

.fg-auth-alert-info {
  background-color: #eff6ff;
  border: 1px solid #dbeafe;
  color: #1e40af;
}

/* Symmetrical Form Fields (54 to 58 px height) */
.fg-form-group {
  margin-bottom: 18px;
}

.fg-field-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 7px;
}

.fg-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.fg-input-text {
  width: 100%;
  height: var(--fg-auth-field-height);
  padding: 0 16px;
  font-size: 15px;
  color: var(--fg-auth-text);
  background-color: #ffffff;
  border: 1px solid var(--fg-auth-border);
  border-radius: var(--fg-auth-radius-field);
  transition: border-color 150ms ease, box-shadow 150ms ease;
  box-sizing: border-box;
}

.fg-input-text::placeholder {
  color: #94a3b8;
}

.fg-input-text:focus {
  outline: none;
  border-color: var(--fg-auth-border-focus);
  box-shadow: 0 0 0 3px var(--fg-auth-primary-focus);
}

.fg-input-text:disabled {
  background-color: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
}

/* Password field with toggle */
.fg-field-wrap-password .fg-input-text {
  padding-right: 50px;
}

.fg-password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: none;
  color: #64748b;
  border-radius: 8px;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}

.fg-password-toggle:hover {
  color: var(--fg-auth-text);
  background: #f1f5f9;
}

.fg-password-toggle:focus-visible {
  outline: 2px solid var(--fg-auth-primary);
  outline-offset: 1px;
  color: var(--fg-auth-primary);
}

.fg-field-hint {
  font-size: 12px;
  color: var(--fg-auth-muted);
  margin-top: 5px;
  display: block;
}

.fg-field-error {
  font-size: 12.5px;
  color: #dc2626;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Options Row (Remember Me + Forgot Password) */
.fg-auth-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  margin-bottom: 22px;
  font-size: 13.5px;
}

.fg-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  cursor: pointer;
  user-select: none;
}

.fg-checkbox-input {
  width: 17px;
  height: 17px;
  border: 1px solid var(--fg-auth-border);
  border-radius: 4px;
  accent-color: var(--fg-auth-primary);
  cursor: pointer;
}

.fg-auth-link {
  color: var(--fg-auth-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 150ms ease;
}

.fg-auth-link:hover {
  color: var(--fg-auth-primary-hover);
  text-decoration: underline;
}

.fg-auth-link:focus-visible {
  outline: 2px solid var(--fg-auth-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Primary Action Button */
.btn-fg-auth-primary {
  width: 100%;
  height: var(--fg-auth-field-height);
  background-color: var(--fg-auth-primary);
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--fg-auth-radius-field);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(11, 77, 156, 0.22);
  transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.btn-fg-auth-primary:hover {
  background-color: var(--fg-auth-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(11, 77, 156, 0.30);
}

.btn-fg-auth-primary:active {
  transform: translateY(0);
}

.btn-fg-auth-primary:focus-visible {
  outline: 3px solid rgba(11, 77, 156, 0.40);
  outline-offset: 3px;
}

.btn-fg-auth-primary:disabled {
  background-color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Secondary Actions / Footer within Card */
.fg-auth-card-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--fg-auth-border);
  text-align: center;
  font-size: 13.5px;
  color: var(--fg-auth-muted);
}

.fg-auth-alt-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

@media (min-width: 480px) {
  .fg-auth-alt-choices {
    flex-direction: row;
    justify-content: center;
  }
}

.fg-alt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: #f8fafc;
  border: 1px solid var(--fg-auth-border);
  border-radius: 10px;
  color: #334155;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 150ms ease;
  min-height: 42px;
}

.fg-alt-btn:hover {
  background: #f1f5f9;
  color: var(--fg-auth-primary);
  border-color: #cbd5e1;
}

.fg-alt-btn:focus-visible {
  outline: 2px solid var(--fg-auth-primary);
  outline-offset: 1px;
}

/* Password Strength Meter */
.fg-password-meter {
  margin-top: 8px;
}

.fg-meter-bars {
  display: flex;
  gap: 4px;
  height: 4px;
  margin-bottom: 6px;
}

.fg-meter-bar {
  flex: 1;
  background: #e2e8f0;
  border-radius: 2px;
  transition: background-color 200ms ease;
}

.fg-meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--fg-auth-muted);
}

.fg-strength-weak .fg-meter-bar:nth-child(1) { background-color: #ef4444; }
.fg-strength-fair .fg-meter-bar:nth-child(1),
.fg-strength-fair .fg-meter-bar:nth-child(2) { background-color: #f59e0b; }
.fg-strength-strong .fg-meter-bar:nth-child(1),
.fg-strength-strong .fg-meter-bar:nth-child(2),
.fg-strength-strong .fg-meter-bar:nth-child(3) { background-color: #0b4d9c; }
.fg-strength-very-strong .fg-meter-bar { background-color: #22c55e; }

/* 3. Minimal Legal Footer */
.fg-auth-footer {
  padding: 24px 16px;
  text-align: center;
  font-size: 12.5px;
  color: #94a3b8;
  border-top: 1px solid var(--fg-auth-border);
  background: #ffffff;
}

.fg-auth-legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 8px;
  list-style: none;
  padding: 0;
}

.fg-auth-legal-links a {
  color: #64748b;
  text-decoration: none;
  transition: color 150ms ease;
}

.fg-auth-legal-links a:hover {
  color: var(--fg-auth-primary);
  text-decoration: underline;
}

.fg-auth-legal-links a:focus-visible {
  outline: 2px solid var(--fg-auth-primary);
  outline-offset: 2px;
}

/* Desktop Split Layout (Optional Reassurance Sidebar on large viewports) */
@media (min-width: 992px) {
  .fg-auth-stage-split {
    display: grid;
    grid-template-columns: 1fr 480px;
    gap: 48px;
    align-items: center;
    max-width: 1040px;
    margin: 0 auto;
    padding: 48px 24px;
  }

  .fg-auth-reassurance {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-right: 24px;
  }

  .fg-reassurance-heading {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
    letter-spacing: -0.02em;
  }

  .fg-reassurance-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .fg-reassurance-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
  }

  .fg-reassurance-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #e0f2fe;
    color: #0284c7;
    display: grid;
    place-items: center;
    flex-shrink: 0;
  }
}

@media (max-width: 991px) {
  .fg-auth-reassurance {
    display: none !important;
  }
}


/* ==========================================================================
   HOMEPAGE BRAND & CONSOLE ALIGNMENT
   ========================================================================== */

.fg-auth-travel-hero {
  padding: 16px 16px 24px;
  position: relative;
  min-height: 148px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  overflow: hidden;
  background-color: #EAF2F8;
}

.fg-hero-auth-title {
  font-size: 24px;
  font-weight: 800;
  color: #071F33;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.fg-hero-auth-sub {
  font-size: 13.5px;
  font-weight: 500;
  color: #546574;
  margin: 0;
  line-height: 1.4;
}

.fg-hero-slogan-script {
  font-family: cursive, 'Brush Script MT', sans-serif;
  font-size: 17px;
  color: #0078F3;
  font-style: italic;
  white-space: nowrap;
}

.fg-auth-stage-aligned {
  padding: 0 16px 96px;
  width: 100%;
}

.fg-auth-container-aligned {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

.fg-auth-card-aligned {
  background: #FFFFFF;
  border-radius: 20px;
  border: 1px solid #E5EEF5;
  box-shadow: 0 4px 20px -2px rgba(7, 31, 51, 0.06), 0 2px 6px -1px rgba(7, 31, 51, 0.04);
  padding: 22px 18px 24px;
  margin-top: -14px;
  position: relative;
  z-index: 10;
}

/* Symmetrical Fields with Icon Alignment */
.fg-field-wrap.fg-field-has-icon {
  position: relative;
}

.fg-field-left-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #8091A0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.fg-field-wrap.fg-field-has-icon .fg-input-text {
  padding-left: 44px;
}

/* Homepage-Matched Yellow Action Button */
.btn-fg-exact-yellow-search.fg-auth-submit-btn {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 24px 1fr 24px;
  align-items: center;
  justify-items: center;
  width: 100%;
  height: 58px;
  background: var(--fg-yellow-btn, #FAB915);
  color: #071C2E;
  border: none;
  border-radius: 15px;
  font-size: 17.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(250, 185, 21, 0.3);
  transition: all 0.15s ease;
  padding: 0 16px;
  letter-spacing: -0.01em;
}

.btn-fg-exact-yellow-search.fg-auth-submit-btn:hover {
  background: var(--fg-yellow-hover, #EAA809);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(250, 185, 21, 0.4);
}

.btn-fg-exact-yellow-search.fg-auth-submit-btn:active {
  transform: translateY(0);
}

.fg-search-btn-icon-col,
.fg-search-btn-arrow-col {
  display: flex;
  align-items: center;
  justify-content: center;
}

.fg-search-btn-text-col {
  text-align: center;
}
