/**
 * HerHealth - Modern Authentication Pages
 * SaaS-style centered login card with trust badges
 */

/* ─── Full-width wrapper for auth pages ─── */
.herhealth-auth-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 100% !important;
  padding: 0 !important;
}

/* Hide the default page-title-wrapper on auth pages */
#authentication .page-title-wrapper {
  display: none !important;
}

/* Remove default card styling from page.tpl */
#authentication #content.page-content.card.card-block {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

#authentication #main {
  margin: 0;
  padding: 0;
}

/* ─── Full-width gradient on the wrapper (not constrained by .container) ─── */
#authentication #wrapper,
#registration #wrapper {
  background: linear-gradient(135deg, #fff1f2 0%, #fafaf9 50%, #fff1f2 100%);
}

/* ─── Auth page container ─── */
.herhealth-auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 48px 20px 64px;
}

/* ─── Auth card ─── */
.herhealth-auth-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 6px 24px rgba(136, 19, 55, 0.06);
  padding: 40px 36px 36px;
  position: relative;
}

/* ─── Brand / Logo ─── */
.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}

.auth-brand a {
  text-decoration: none;
}

.auth-logo {
  height: 40px;
  width: auto;
}

.auth-logo-fallback {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #881337;
  letter-spacing: -0.01em;
}

/* ─── Heading ─── */
.auth-heading {
  text-align: center;
  margin-bottom: 32px;
}

.auth-heading h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.625rem;
  font-weight: 700;
  color: #1c1917;
  margin: 0 0 8px;
  line-height: 1.25;
}

.auth-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: #78716c;
  margin: 0;
  line-height: 1.5;
}

/* ─── Alert / Error ─── */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 24px;
  font-size: 0.875rem;
  line-height: 1.5;
}

.auth-alert p {
  margin: 0;
}

.auth-alert-error {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #9f1239;
}

.auth-alert-error .material-icons {
  color: #e11d48;
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ─── Form fields ─── */
.auth-field {
  margin-bottom: 20px;
}

.auth-field label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #44403c;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.auth-field label .required-dot {
  color: #e11d48;
  margin-left: 2px;
}

.auth-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  color: #1c1917;
  background: #fafaf9;
  border: 1.5px solid #d6d3d1;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  box-sizing: border-box;
}

.auth-input:hover {
  border-color: #a8a29e;
}

.auth-input:focus {
  border-color: #881337;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(136, 19, 55, 0.08);
}

.auth-input::placeholder {
  color: transparent;
}

/* Error state */
.auth-field-error .auth-input {
  border-color: #e11d48;
  background: #fff1f2;
}

.auth-field-error .auth-input:focus {
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.1);
}

.auth-field-msg {
  display: block;
  font-size: 0.8125rem;
  color: #e11d48;
  margin-top: 6px;
}

/* ─── Password field ─── */
.auth-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-password-wrapper .auth-input {
  padding-right: 50px;
}

.auth-toggle-password {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #78716c;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-toggle-password:hover {
  color: #881337;
  background: rgba(136, 19, 55, 0.05);
}

.auth-toggle-password .material-icons {
  font-size: 20px;
}

/* ─── Password strength meter (zxcvbn) ─── */
.field-password-policy .js-input-column {
  width: 100%;
}

.field-password-policy .password-strength-feedback {
  margin-top: 10px;
  font-family: 'Inter', sans-serif;
}

.field-password-policy .progress {
  height: 6px;
  background: #f5f5f4;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}

.field-password-policy .progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.25s ease, background-color 0.25s ease;
}

.field-password-policy .progress-bar.bg-danger { background-color: #dc2626; }
.field-password-policy .progress-bar.bg-warning { background-color: #f59e0b; }
.field-password-policy .progress-bar.bg-success { background-color: #16a34a; }

.field-password-policy .password-strength-text {
  font-size: 0.8125rem;
  color: #b45309;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 10px;
  line-height: 1.45;
}

.field-password-policy .password-strength-text:empty {
  display: none;
}

.field-password-policy .password-requirements {
  margin: 0;
  padding: 0;
  list-style: none;
}

.field-password-policy .password-requirements p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 0.8125rem;
  color: #78716c;
  line-height: 1.4;
}

.field-password-policy .password-requirements p .material-icons {
  font-size: 16px;
  color: #d6d3d1;
  transition: color 0.2s ease;
}

.field-password-policy .password-requirements p .material-icons.text-success {
  color: #16a34a;
}

.field-password-policy .auth-input.border-success {
  border-color: #16a34a !important;
}

.field-password-policy .auth-input.border-danger {
  border-color: #dc2626 !important;
}

/* Suppress the bundled-theme.js password popover; we render inline instead */
body#registration .popover,
body#authentication .popover,
body#identity .popover,
body#password .popover {
  display: none !important;
}

/* ─── Forgot password ─── */
.auth-forgot {
  text-align: right;
  margin-bottom: 24px;
  margin-top: -8px;
}

.auth-forgot a {
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #881337;
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-forgot a:hover {
  color: #9f1239;
  text-decoration: underline;
}

/* ─── Primary button ─── */
.auth-btn-primary {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 24px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #881337 0%, #9f1239 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  letter-spacing: 0.01em;
  line-height: 48px;
  text-align: center;
}

.auth-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(136, 19, 55, 0.25);
}

.auth-btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

.auth-btn-primary:focus-visible {
  outline: 2px solid #881337;
  outline-offset: 2px;
}

/* ─── Disabled state (consent boxes not yet ticked) ─── */
.auth-btn-primary:disabled,
.auth-btn-primary[disabled] {
  background: #d4d4d8;                     /* zinc-300 */
  color: #71717a;                          /* zinc-500 */
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.auth-btn-primary:disabled:hover,
.auth-btn-primary[disabled]:hover {
  transform: none;
  box-shadow: none;
}

/* ─── Divider ─── */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 28px 0;
}

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

.auth-divider span {
  padding: 0 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  color: #a8a29e;
  text-transform: lowercase;
}

/* ─── Create account ─── */
.auth-create-account {
  text-align: center;
}

.auth-create-account p {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  color: #78716c;
  margin: 0 0 12px;
}

.btn-create-account {
  display: block;
  width: 100%;
  height: 46px;
  line-height: 42px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #881337;
  background: transparent;
  border: 1.5px solid #881337;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  text-decoration: none;
  text-align: center;
}

.btn-create-account:hover {
  background: #fff1f2;
  color: #881337;
  text-decoration: none;
  transform: translateY(-1px);
}

/* ─── Trust badges ─── */
.auth-trust-badges {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: #78716c;
}

.trust-badge .material-icons {
  font-size: 16px;
  color: #881337;
  opacity: 0.7;
}

/* ─── Hide default PrestaShop form structure on auth page ─── */
#authentication .page-footer,
#authentication .page-content > hr {
  display: none;
}

#authentication .no-account,
#authentication .forgot-password {
  display: none;
}

/* Hide default notifications container — errors shown inside card */
#authentication #notifications {
  display: none;
}

/* ─── Responsive ─── */
@media (max-width: 767px) {
  .herhealth-auth-page {
    padding: 32px 16px 48px;
    min-height: auto;
  }

  .herhealth-auth-card {
    padding: 32px 24px 28px;
    border-radius: 12px;
  }

  .auth-heading h1 {
    font-size: 1.375rem;
  }

  .auth-trust-badges {
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .herhealth-auth-card {
    padding: 28px 20px 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  }

  .auth-trust-badges {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
}


/* ═══════════════════════════════════════════════
   Registration Page — extends auth card styles
   ═══════════════════════════════════════════════ */

/* Hide default page-title-wrapper on registration page */
#registration .page-title-wrapper {
  display: none !important;
}

/* Remove default card styling from page.tpl on registration */
#registration #content.page-content.card.card-block {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

#registration #main {
  margin: 0;
  padding: 0;
}

#registration .page-footer,
#registration .page-content > hr {
  display: none;
}

#registration #notifications {
  display: none;
}

/* Wider card for registration (more fields) */
.herhealth-auth-card--register {
  max-width: 480px;
}

/* ─── Radio buttons (Social title) ─── */
.auth-field-radio {
  margin-bottom: 20px;
}

.auth-radio-label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #44403c;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.auth-radio-group {
  display: flex;
  gap: 12px;
}

.auth-radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #fafaf9;
  border: 1.5px solid #d6d3d1;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  flex: 1;
  justify-content: center;
}

.auth-radio-option:hover {
  border-color: #a8a29e;
}

.auth-radio-option--active,
.auth-radio-option:has(input:checked) {
  border-color: #881337;
  background: #fff1f2;
}

.auth-radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.auth-radio-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #d6d3d1;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.2s ease;
}

.auth-radio-option--active .auth-radio-dot,
.auth-radio-option:has(input:checked) .auth-radio-dot {
  border-color: #881337;
}

.auth-radio-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #881337;
  transition: transform 0.2s ease;
}

.auth-radio-option--active .auth-radio-dot::after,
.auth-radio-option:has(input:checked) .auth-radio-dot::after {
  transform: translate(-50%, -50%) scale(1);
}

.auth-radio-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: #44403c;
}

/* ─── Checkboxes ─── */
.auth-field-checkbox {
  margin-bottom: 14px;
}

.auth-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  color: #57534e;
  line-height: 1.5;
}

.auth-checkbox-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.auth-checkbox-box {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 1.5px solid #d6d3d1;
  border-radius: 5px;
  background: #fafaf9;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, background 0.2s ease;
  margin-top: 1px;
}

.auth-checkbox-input:checked + .auth-checkbox-box {
  background: #881337;
  border-color: #881337;
}

.auth-checkbox-check {
  width: 12px;
  height: 10px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.auth-checkbox-input:checked + .auth-checkbox-box .auth-checkbox-check {
  opacity: 1;
  transform: scale(1);
}

.auth-checkbox-input:focus-visible + .auth-checkbox-box {
  outline: 2px solid #881337;
  outline-offset: 2px;
}

.auth-checkbox-text {
  flex: 1;
}

.auth-checkbox-text a {
  color: #881337;
  text-decoration: none;
  font-weight: 500;
}

.auth-checkbox-text a:hover {
  text-decoration: underline;
}

.auth-checkbox-text em,
.auth-checkbox-text i {
  display: block;
  font-style: normal;
  font-size: 0.75rem;
  color: #a8a29e;
  margin-top: 2px;
}

/* ─── Date / Birthdate hint ─── */
.auth-field-hint {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: #a8a29e;
  margin-top: 6px;
}

/* ─── Native date input (birthday picker) ─── */
.auth-input-date {
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  color: #1c1917;
  padding-right: 14px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

/* Empty-state placeholder color (Chromium shows "mm/dd/yyyy") */
.auth-input-date:not(:focus):in-range::-webkit-datetime-edit { color: #1c1917; }
.auth-input-date::-webkit-datetime-edit { padding: 0; }
.auth-input-date:invalid::-webkit-datetime-edit,
.auth-input-date:not(:focus):invalid::-webkit-datetime-edit-fields-wrapper {
  color: #a8a29e;
}

/* Calendar picker indicator — Chromium / Edge / Safari */
.auth-input-date::-webkit-calendar-picker-indicator {
  cursor: pointer;
  padding: 6px;
  margin-right: -4px;
  border-radius: 8px;
  opacity: 0.55;
  filter: invert(20%) sepia(35%) saturate(2500%) hue-rotate(320deg);
  transition: opacity 0.2s ease, background 0.2s ease;
}

.auth-input-date::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background: rgba(136, 19, 55, 0.08);
}

.auth-input-date:focus::-webkit-calendar-picker-indicator {
  opacity: 1;
}

/* Firefox calendar styling */
@-moz-document url-prefix() {
  .auth-input-date { color-scheme: light; }
}

/* ─── Registration form footer ─── */
#customer-form .form-footer {
  margin-top: 28px;
  padding: 0;
  border: none;
}

/* ─── Password policy (strength meter) ─── */
.field-password-policy .password-strength-feedback {
  margin-top: 8px;
}

.field-password-policy .progress {
  height: 4px;
  border-radius: 2px;
  background: #e7e5e4;
  margin-bottom: 6px;
  overflow: hidden;
}

.field-password-policy .progress-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.field-password-policy .password-requirements {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: #78716c;
}

/* ═══════════════════════════════════════════════
   Content-wrapper width fix for all pages
   ═══════════════════════════════════════════════ */

/* When left/right columns are empty, hide them */
#left-column:empty,
#right-column:empty {
  display: none !important;
  width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  flex: 0 0 0 !important;
  min-width: 0 !important;
}

/* Make row-wrapper a proper flex container */
.row-wrapper {
  display: flex;
  flex-wrap: wrap;
}

/* When both sidebars are hidden, content fills full width */
.row-wrapper #content-wrapper.left-column.right-column {
  flex: 1 1 auto;
  max-width: 100%;
  width: 100%;
}

/* ─── Page-specific full-width overrides ─── */
/* All auth/account-related pages that don't need sidebars */
#authentication #left-column,
#authentication #right-column,
#password #left-column,
#password #right-column,
#registration #left-column,
#registration #right-column,
#guest-login #left-column,
#guest-login #right-column,
#guest-tracking #left-column,
#guest-tracking #right-column,
#discount #left-column,
#discount #right-column,
#address #left-column,
#address #right-column,
#search #left-column,
#search #right-column,
#pagenotfound #left-column,
#pagenotfound #right-column,
#order-confirmation #left-column,
#order-confirmation #right-column {
  display: none !important;
  width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  flex: 0 0 0 !important;
}

#authentication .row-wrapper #content-wrapper,
#password .row-wrapper #content-wrapper,
#registration .row-wrapper #content-wrapper,
#guest-login .row-wrapper #content-wrapper,
#guest-tracking .row-wrapper #content-wrapper,
#discount .row-wrapper #content-wrapper,
#address .row-wrapper #content-wrapper,
#search .row-wrapper #content-wrapper,
#pagenotfound .row-wrapper #content-wrapper,
#order-confirmation .row-wrapper #content-wrapper {
  flex: 0 0 100% !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* ═══════════════════════════════════════════════
   Registration page — wider card, 2-column grid,
   inline checkbox labels (added 2026-04-27)
   ═══════════════════════════════════════════════ */

/* Tighten vertical padding so the form fits one viewport */
#registration .herhealth-auth-page {
  padding: 24px 20px 40px;
  min-height: auto;
}

#registration .auth-heading {
  margin-bottom: 20px;
}

#registration .auth-brand {
  margin-bottom: 16px;
}

/* Wider card — reduces side whitespace and enables 2-column form */
@media (min-width: 768px) {
  .herhealth-auth-card--register {
    max-width: 880px;
    padding: 32px 48px 28px;
  }

  /* Grid the foreach-rendered fields */
  #customer-form > div:first-of-type {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 24px;
    row-gap: 0;
    align-items: start;
  }

  /* Full-width rows: social title, birthday, every checkbox */
  #customer-form > div:first-of-type > .auth-field-radio,
  #customer-form > div:first-of-type > .auth-field-birthday,
  #customer-form > div:first-of-type > .auth-field-checkbox {
    grid-column: 1 / -1;
  }

  /* Password column may have a strength-meter that pops up below — give it
     enough breathing room so it doesn't overflow into the next row */
  #customer-form > div:first-of-type > .field-password-policy {
    min-height: 0;
  }
}

/* Tighter spacing between stacked checkboxes */
#customer-form .auth-field-checkbox {
  margin-bottom: 10px;
}

#customer-form .auth-field-checkbox + .auth-field-checkbox {
  margin-top: -2px;
}

/* Less vertical breathing room overall on register page */
#registration .auth-field {
  margin-bottom: 14px;
}

/* ─── Inline checkbox + label fix ─── */
/* `.auth-field label { display: block }` was overriding the intended flex
   layout, and `.auth-checkbox-box { display: flex }` (block-level flex)
   forced the text span onto a new line. Force flex on the label and switch
   the box to inline-flex. */
.auth-field-checkbox .auth-checkbox-label {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 0 !important;
  font-size: 0.8125rem;
  font-weight: 400;
  color: #57534e;
  letter-spacing: 0;
  line-height: 1.45;
}

.auth-field-checkbox .auth-checkbox-box {
  display: inline-flex;
}

/* Tighten the data-privacy notice (long PIPEDA text) so it doesn't blow
   out the form height. The <em>/<i> already render as a separate block
   below the lead text — keep that, but reduce font-size. */
.auth-field-checkbox .auth-checkbox-text {
  font-size: 0.8125rem;
}

.auth-field-checkbox .auth-checkbox-text strong {
  font-weight: 600;
  color: #44403c;
}

.auth-field-checkbox .auth-checkbox-text em,
.auth-field-checkbox .auth-checkbox-text i {
  display: block;
  font-style: normal;
  font-size: 0.7rem;
  color: #78716c;
  margin-top: 4px;
  line-height: 1.4;
}

/* Submit button row */
#registration #customer-form .form-footer {
  margin-top: 18px;
}

/* Trust badges — pull closer to the card */
#registration .auth-trust-badges {
  margin-top: 18px;
}

/* Mobile: revert to single column (default) */
@media (max-width: 767px) {
  .herhealth-auth-card--register {
    max-width: 480px;
  }
}
