/* ============================================================
   Mediterranean Wellness – Login Pages Redesign
   Covers: login.php (forgotpassword.php + user_lookup.php to follow)
   Single responsive file — no separate English/Spanish sheets
   ============================================================ */

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

:root {
  --brand-teal:   #29a4c4;
  --brand-dark:   #1a6882;
  --brand-text:   #1a7a96;
  --brand-green:  #7ab317;
  --brand-hover:  #155470;
  --neutral-900:  #1e2d35;
  --neutral-600:  #4a5e66;
  --neutral-300:  #c8d8dc;
  --neutral-100:  #f7f8f9;
  --white:        #ffffff;
  --error:        #b91c1c;
  --radius:       10px;
  --shadow:       0 0 32px rgba(26, 104, 130, .50), 0 0 8px rgba(0, 0, 0, .10);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--neutral-100);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  color: var(--neutral-900);
}

/* ── Accessibility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 16px;
  background: var(--brand-dark);
  color: var(--white);
  padding: 8px 14px;
  border-radius: 0 0 6px 6px;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  z-index: 100;
  transition: top .15s;
}
.skip-link:focus { top: 0; }

/* ── Main wrapper ── */
main {
  width: 100%;
  max-width: 960px;
}

/* ── Card ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  overflow: hidden;
}

/* Top gradient bar */
.card-bar {
  height: 5px;
  background: linear-gradient(90deg, var(--brand-dark) 0%, var(--brand-teal) 60%, var(--brand-green) 100%);
}

/* ── Two-column grid ── */
.card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* ── Left hero panel ── */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 340px;
}
.hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* ── Right forms panel ── */
.forms-panel {
  padding: 40px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.forms-panel h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--neutral-600);
  margin: 0;
}

/* ── Logo containers ── */
/* Single-logo default */
.companyLogoContainer {
  display: flex;
  align-items: center;
}
.companyLogoContainer img {
  height: 52px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  object-position: left center;
}

/* Two-logo layouts (Excellus / Univera) */
.excellusLogos,
.univeraLogos {
  display: flex;
  align-items: center;
  gap: 12px;
}
.excellusLoginLogo,
.univeraLoginLogo,
.ih21LoginLogo {
  flex: 1;
}
.excellusLogos img,
.univeraLogos img,
.ih21LoginLogo img {
  max-height: 48px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

/* Shared image helpers (keep Bootstrap-compatible classes working) */
.center-block {
  display: block;
  margin-right: auto;
  margin-left: auto;
}
.img-responsive {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ── Alert section ── */
.alert-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Alerts (info/success/error all share styling) */
.loginAlertBox,
.loginAlertBox_ {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: .875rem;
  line-height: 1.5;
  background: #fef2f2;
  color: var(--error);
  border: 1px solid #fca5a5;
}
.loginAlertBox p,
.loginAlertBox_ p {
  margin: 0;
}
.loginAlertBox a,
.loginAlertBox_ a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Field ── */
.field-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
label.field-label {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--neutral-900);
}
.field-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  font-size: .9375rem;
  border: 1.5px solid var(--neutral-300);
  border-radius: 6px;
  color: var(--neutral-900);
  background: var(--white);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field-input:focus {
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 3px rgba(26, 104, 130, .18);
}
.field-input::placeholder { color: #8fa7af; }

/* ── Password show/hide toggle ── */
.password-wrap {
  position: relative;
}
.password-wrap .field-input {
  padding-right: 44px;
}
.toggle-pw {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--neutral-600);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  outline: none;
  line-height: 1;
}
.toggle-pw:focus-visible { box-shadow: 0 0 0 3px rgba(26, 104, 130, .4); }
.toggle-pw:hover { color: var(--brand-dark); }

/* ── Primary action button ── */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 42px;
  padding: 0 24px;
  background: var(--brand-dark);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-size: .9375rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  cursor: pointer;
  outline: none;
  transition: background .15s, transform .1s, box-shadow .15s;
}
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible { box-shadow: 0 0 0 3px rgba(26, 104, 130, .4); }

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--neutral-300);
}

/* ── Footer links ── */
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  font-size: .875rem;
  color: var(--neutral-600);
}
.footer-links a {
  color: var(--brand-text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer-links a:focus-visible {
  outline: 3px solid var(--brand-dark);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Language picker ── */
.lang-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  flex-wrap: wrap;
}
.lang-label {
  width: 100%;
  text-align: center;
  font-size: .875rem;
  color: var(--neutral-600);
}
.lang-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 2px solid transparent;
  font-size: .8125rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .03em;
  outline: none;
  line-height: 1.4;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.lang-btn:focus-visible { box-shadow: 0 0 0 3px rgba(26, 104, 130, .4); }
.lang-btn[aria-pressed="true"] {
  background: var(--brand-dark);
  color: var(--white);
  border-color: var(--brand-dark);
}
.lang-btn[aria-pressed="false"] {
  background: transparent;
  color: var(--brand-text);
  border-color: var(--brand-teal);
}
.lang-btn[aria-pressed="false"]:hover {
  background: var(--neutral-100);
}

/* ============================================================
   ACCOUNT RECOVERY PAGE (forgotpassword.php)
   ============================================================ */

/* Logo centered in the right (forms) column */
.recovery-logo-wrap {
  display: flex;
  justify-content: center;
}

/* Dark gradient hero — overrides image-based .hero */
.hero.recovery-hero {
  background: linear-gradient(160deg, var(--brand-dark) 0%, #0f4255 100%);
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 20px;
  min-height: auto;
  color: var(--white);
}
.hero.recovery-hero::after {
  content: '';
  position: absolute;
  bottom: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 40px solid rgba(41,164,196,.18);
  pointer-events: none;
}
.hero.recovery-hero > img { display: none; }

.hero-copy h1 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 12px;
  color: var(--white);
}
.hero-copy p {
  font-size: .9375rem;
  line-height: 1.6;
  color: rgba(255,255,255,.82);
}

.hero-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hero-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: .875rem;
  color: rgba(255,255,255,.78);
  line-height: 1.5;
}
.hero-step-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(41,164,196,.35);
  color: var(--white);
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

/* Bordered form card within the right panel */
.form-section {
  border: 1.5px solid var(--neutral-300);
  border-radius: 8px;
  padding: 24px;
  transition: border-color .2s;
}
.form-section:focus-within {
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 3px rgba(26,104,130,.15);
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--neutral-900);
  margin-bottom: 6px;
}
.section-desc {
  font-size: .875rem;
  color: var(--neutral-600);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Stacked input + submit button */
.field-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.field-row .btn-primary { width: 100%; }

/* Footer area (lang + link) pinned to bottom of forms panel */
.forms-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ============================================================
   USER LOOKUP / REGISTRATION PAGE (user_lookup.php)
   ============================================================ */

/* Uppercase label variant */
.field-label--upper {
  font-weight: 700;
  color: var(--brand-dark);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Two-column field layout (Birthday + Company Code) */
.field-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Field + required asterisk side by side */
.field-with-star {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}
.field-with-star .field-wrap { flex: 1; }

/* Required asterisk */
.required-star {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 42px;
  color: var(--brand-dark);
  font-size: 1rem;
  font-weight: 700;
}

/* Birthday date input */
.date-wrap { position: relative; }
.date-wrap .field-input { padding-right: 40px; }
.date-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--neutral-600);
  pointer-events: none;
  display: flex;
  align-items: center;
}

/* Required fields note */
.required-note {
  font-size: .8rem;
  color: var(--neutral-600);
}
.required-note span {
  color: var(--brand-dark);
  font-weight: 700;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet: tighten padding, keep two columns */
@media (max-width: 780px) {
  .forms-panel { padding: 32px 28px; gap: 16px; }
  .hero.recovery-hero { padding: 32px 28px; gap: 16px; }
}

/* Mobile: single column, hero becomes a banner */
@media (max-width: 620px) {
  body {
    padding: 0;
    align-items: stretch;
    justify-content: flex-start;
  }
  .card {
    border-radius: 0;
    box-shadow: none;
    min-height: 100vh;
  }
  .card-body { grid-template-columns: 1fr; }

  .hero {
    min-height: 0;
    height: 200px;
  }
  .hero > img {
    object-position: center 20%;
  }

  .hero.recovery-hero {
    height: auto;
    padding: 24px 20px 28px;
    gap: 14px;
  }
  .hero.recovery-hero::after { display: none; }
  .hero-copy h1 { font-size: 1.25rem; }
  .hero-copy p { font-size: .875rem; }
  .form-section { padding: 18px; }

  .forms-panel {
    padding: 28px 24px 36px;
    gap: 16px;
  }
  .companyLogoContainer img { height: 44px; }
  .btn-primary { font-size: .9rem; }
  .lang-row { justify-content: center; }
  .footer-links { font-size: .8125rem; }
  .field-row-2 { grid-template-columns: 1fr; }
}

/* Small phones */
@media (max-width: 380px) {
  .hero { height: 160px; }
  .hero.recovery-hero { padding: 20px 16px 24px; }
  .form-section { padding: 14px; }
  .forms-panel { padding: 22px 18px 30px; }
  .companyLogoContainer img { height: 38px; }
}
