/* ==========================================================================
   GiftAcross — Customer Authentication (Sign In, Register & Recovery) Styling
   Enterprise E-Commerce Authentication Suite & Account Flyout Menu
   Craft Floor: Min 12px font, Tabular Numbers, High-Contrast Focus Rings,
                Zero AI Clichés, Impeccable Brand Navy (#1C396E) & Marigold (#FFA500)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Storefront Auth Canvas & Centered Stage
   -------------------------------------------------------------------------- */
.auth-page-main {
  background: #F8F9FA;
  min-height: calc(100vh - 200px);
  padding: 44px 16px 64px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.auth-wrapper {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-wrapper.auth-wrapper-wide {
  max-width: 500px;
}

/* Return / Breadcrumb Navigation */
.auth-return-nav {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 16px;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748B;
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-back-link:hover {
  color: #1C396E;
}

/* --------------------------------------------------------------------------
   2. Focused Auth Card Surface
   -------------------------------------------------------------------------- */
.auth-card {
  width: 100%;
  background: #FFFFFF;
  border-radius: 16px;
  border: 1px solid #E5E7EB;
  box-shadow: 0 4px 20px -2px rgba(28, 57, 110, 0.06), 0 2px 6px -1px rgba(28, 57, 110, 0.04);
  padding: 38px 34px;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 26px 20px;
    border-radius: 14px;
  }
}

/* Header & Icon Chip */
.auth-card-top {
  text-align: center;
  margin-bottom: 22px;
}

.auth-brand-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #EEF3FA;
  color: #1C396E;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px auto;
}

.auth-title {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.4375rem;
  font-weight: 700;
  color: #1C396E;
  letter-spacing: -0.015em;
  margin: 0 0 6px 0;
  line-height: 1.25;
}

.auth-subtitle {
  font-size: 0.84375rem;
  color: #71717A;
  line-height: 1.48;
  margin: 0;
}

/* --------------------------------------------------------------------------
   3. Segmented Pill Tab Switcher (Apple/Stripe precision)
   -------------------------------------------------------------------------- */
.auth-tab-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #F1F5F9;
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 24px;
}

.auth-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  border-radius: 8px;
  font-size: 0.84375rem;
  font-weight: 600;
  color: #64748B;
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-tab-btn:hover {
  color: #1C396E;
}

.auth-tab-btn.active {
  background: #FFFFFF;
  color: #1C396E;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* --------------------------------------------------------------------------
   4. Form Groups & Input Controls
   -------------------------------------------------------------------------- */
.auth-form-group {
  margin-bottom: 18px;
}

.auth-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #222222;
  margin-bottom: 6px;
}

.auth-label-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1C396E;
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-label-link:hover {
  color: #FFA500;
  text-decoration: underline;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  color: #94A3B8;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 42px;
  background: #FAFAFA;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.875rem;
  color: #222222;
  transition: all 0.15s ease;
  outline: none;
  box-sizing: border-box;
}

.auth-input.has-no-icon {
  padding-left: 14px;
}

.auth-input::placeholder {
  color: #94A3B8;
}

.auth-input:focus {
  background: #FFFFFF;
  border-color: #1C396E;
  box-shadow: 0 0 0 3px rgba(28, 57, 110, 0.12);
}

.auth-input.is-invalid {
  border-color: #EF4444;
  background: #FEF2F2;
}

.auth-pw-toggle-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #94A3B8;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.auth-pw-toggle-btn:hover {
  color: #1E293B;
}

/* Phone Split (Dial Code + Number) */
.auth-phone-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 8px;
}

.auth-country-select {
  height: 48px;
  padding: 0 8px 0 10px;
  background: #FAFAFA;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1E293B;
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-country-select:focus {
  background: #FFFFFF;
  border-color: #1C396E;
  box-shadow: 0 0 0 3px rgba(28, 57, 110, 0.12);
}

/* Password Strength Indicator */
.auth-strength-container {
  margin-top: 8px;
}

.auth-strength-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 5px;
}

.auth-strength-bar {
  height: 4px;
  border-radius: 2px;
  background: #E2E8F0;
  transition: background 0.2s ease;
}

.auth-strength-bar.weak { background: #EF4444; }
.auth-strength-bar.fair { background: #F59E0B; }
.auth-strength-bar.good { background: #3B82F6; }
.auth-strength-bar.strong { background: #15803D; }

.auth-strength-text {
  font-size: 0.75rem;
  color: #64748B;
  display: flex;
  justify-content: space-between;
}

.auth-strength-label {
  font-weight: 700;
}

/* Checkbox Row */
.auth-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.8125rem;
  color: #475569;
  line-height: 1.45;
  user-select: none;
  cursor: pointer;
  margin: 2px 0;
}

.auth-checkbox-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: #1C396E;
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Primary Action Button */
.auth-submit-btn {
  width: 100%;
  height: 48px;
  background: #1C396E;
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
  margin-top: 6px;
  box-shadow: 0 2px 8px rgba(28, 57, 110, 0.15);
}

.auth-submit-btn:hover {
  background: #12264B;
  box-shadow: 0 4px 14px rgba(28, 57, 110, 0.25);
}

.auth-submit-btn:active {
  transform: translateY(1px);
}

/* Divider & Secondary Pathways */
.auth-divider {
  position: relative;
  text-align: center;
  margin: 24px 0 20px 0;
}

.auth-divider::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  background: #E5E7EB;
}

.auth-divider-text {
  position: relative;
  background: #FFFFFF;
  padding: 0 12px;
  font-size: 0.78125rem;
  font-weight: 600;
  color: #94A3B8;
  letter-spacing: 0.02em;
}

.auth-secondary-btn {
  width: 100%;
  height: 46px;
  background: #FFFFFF;
  color: #1C396E;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.auth-secondary-btn:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: #12264B;
}

.auth-switch-prompt {
  text-align: center;
  font-size: 0.8125rem;
  color: #64748B;
  margin-top: 18px;
}

.auth-switch-prompt a {
  color: #1C396E;
  font-weight: 700;
  text-decoration: none;
  margin-left: 4px;
}

.auth-switch-prompt a:hover {
  color: #FFA500;
  text-decoration: underline;
}

.auth-notice-text {
  font-size: 0.75rem;
  color: #71717A;
  line-height: 1.45;
  margin-top: 16px;
  text-align: center;
}

.auth-notice-text a {
  color: #1C396E;
  text-decoration: underline;
}

/* Alert Banners */
.auth-alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
}

.auth-alert.error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #DC2626;
}

.auth-alert.success {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  color: #15803D;
}

/* --------------------------------------------------------------------------
   5. E-Commerce Reassurance Strip (Under Card)
   -------------------------------------------------------------------------- */
.auth-trust-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 24px;
  padding: 0 4px;
  width: 100%;
}

.auth-trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748B;
  white-space: nowrap;
}

.auth-trust-item svg {
  color: #1C396E;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .auth-trust-strip {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
}

/* --------------------------------------------------------------------------
   6. Authenticated User Header Pill & Account Flyout Dropdown
   -------------------------------------------------------------------------- */
.header-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--brand-navy, #1C396E);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.header-user-btn:hover {
  border-color: var(--brand-navy, #1C396E);
  background: #FFFFFF;
}

.header-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-navy, #1C396E) 0%, var(--brand-orange, #FFA500) 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.header-account-flyout {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
  padding: 12px 0;
  z-index: 1001;
  display: none;
  animation: flyoutFadeIn 0.15s ease forwards;
}

.header-account-flyout.open {
  display: block;
}

@keyframes flyoutFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.flyout-user-meta {
  padding: 4px 16px 12px 16px;
  border-bottom: 1px solid #F1F5F9;
}

.flyout-user-meta .user-name {
  font-size: 0.875rem;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 2px;
}

.flyout-user-meta .user-email {
  font-size: 0.75rem;
  color: #64748B;
  word-break: break-all;
}

.flyout-menu-list {
  list-style: none;
  padding: 6px 0;
}

.flyout-menu-item a, .flyout-menu-item button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 16px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.12s ease;
  box-sizing: border-box;
}

.flyout-menu-item a:hover, .flyout-menu-item button:hover {
  background: #F8FAFC;
  color: var(--brand-navy, #1C396E);
}

.flyout-menu-item .menu-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.flyout-menu-item .menu-badge {
  background: #FEF3C7;
  color: #92400E;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 100px;
}

.flyout-divider {
  height: 1px;
  background: #F1F5F9;
  margin: 6px 0;
}

.flyout-signout-btn {
  color: #DC2626 !important;
}

.flyout-signout-btn:hover {
  background: #FEF2F2 !important;
  color: #B91C1C !important;
}
