/**
 * My Account Page Modernisation – Custom Styles
 *
 * Override via functions-for-woo plugin.
 * Contains all my-account login page styling.
 *
 * @package Functions-For-Woo
 */

/* ============================================
   SHARED FORM TOKENS – Uniform style/size/family
   for every form on the My Account page.
   ============================================ */

:root {
  --ffw-form-font-family: inherit;
  --ffw-form-label-size: 14px;
  --ffw-form-label-weight: 600;
  --ffw-form-label-color: #333;
  --ffw-form-input-size: 15px;
  --ffw-form-input-color: #333;
  --ffw-form-input-height: 48px;
  --ffw-form-input-border: 1px solid rgba(0, 0, 0, 0.2);
  --ffw-form-input-radius: 8px;
  --ffw-form-row-gap: 18px;
  --ffw-form-btn-size: 16px;
  --ffw-form-btn-weight: 700;
  --ffw-form-btn-radius: 8px;
}

/*
 * Apply the shared family to every form wrapper on the account page
 * so labels, inputs, selects and buttons all inherit the same stack.
 */
.woocommerce-account .ffw-myaccount-login-form,
.woocommerce-account .ffw-myaccount-register-form,
.woocommerce-account .woocommerce-ResetPassword.lost_reset_password,
.woocommerce-account .woocommerce-EditAccountForm.edit-account,
.woocommerce-account .woocommerce-address-fields {
  font-family: var(--ffw-form-font-family);
}

/* ============================================
   MY ACCOUNT LOGIN PAGE – Two-column layout
   ============================================ */

/*
 * Outer wrapper – full-width with light mint background.
 * Uses primary colour at low opacity for a subtle tint.
 */
.ffw-myaccount-login-section {
  background: rgba(var(--wooPrimary-rgb, 0, 174, 215), 0.06);
  padding: 48px 0px;
  padding-left: 60px;
  padding-bottom: 20px;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  overflow-x: hidden;
}

/*
 * Two-column flex container.
 * Left (info): 40%  |  Right (form card): 60%
 */
.ffw-myaccount-login-wrap {
  display: flex;
  align-items: flex-start;
  gap: 48px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ── LEFT COLUMN: Informational text ── */
.ffw-myaccount-info-col {
  width: 38%;
  flex-shrink: 0;
  padding-top: 20px;
  box-sizing: border-box;
}

.ffw-info-heading {
  font-size: 16px;
  font-weight: 300;
  color: black;
  margin: 0 0 14px;
  line-height: 1.35;
}

.ffw-info-subheading {
  font-size: 16px;
  color: black;
  font-weight: 300;
  margin: 0 0 16px;
  margin-top: 30px;
  line-height: 1.5;
}

.ffw-info-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ffw-info-link {
  color: var(--wooPrimary, #13807d);
  font-size: 16px;
  font-weight: 400;
  display: inline-block;
  cursor: default;
}

.ffw-info-list li {
  margin-bottom: -7px;
}

.ffw-info-link:hover {
  color: var(--wooPrimary, #13807d);
  text-decoration: none;
}

/* ── RIGHT COLUMN: White card with login form ── */
.ffw-myaccount-form-col {
  width: 56%;
  flex-shrink: 0;
  box-sizing: border-box;
}

.ffw-myaccount-login-card {
  background: #fff;
  padding: 65px 40px 40px;
  box-sizing: border-box;
  width: 100%;
}

/* Card title – "Login" */
.ffw-card-title {
  font-size: 26px;
  font-weight: 400;
  color: #1a1a1a;
  margin: 0 0 28px;
  line-height: 1.2;
}

/* Override default WooCommerce form border / padding */
.ffw-myaccount-login-form.login {
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* ── Form rows ── */
.ffw-form-row {
  margin: 0 0 18px;
}

.ffw-form-row label {
  display: block;
  font-size: var(--ffw-form-label-size);
  font-weight: var(--ffw-form-label-weight);
  color: var(--ffw-form-label-color);
  margin-bottom: 6px;
}

.ffw-form-row label .required {
  color: #e2401c;
  text-decoration: none;
}

/* Input fields */
.ffw-input-text {
  width: 100%;
  padding: 12px 14px;
  border: var(--ffw-form-input-border);
  border-radius: var(--ffw-form-input-radius);
  font-size: var(--ffw-form-input-size);
  color: var(--ffw-form-input-color);
  background: #fff;
  box-sizing: border-box;
  height: var(--ffw-form-input-height);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.ffw-input-text:focus {
  outline: none;
  border-color: var(--wooPrimary, #13807d);
  box-shadow: 0 0 0 3px rgba(var(--wooPrimary-rgb, 0, 174, 215), 0.12);
}

/* ── Password field – WooCommerce native eye toggle ── */
.ffw-password-field input.ffw-input-text {
  padding-right: 40px;
}
.ffw-password-field .password-input {
  position: relative;
  display: block;
}
.ffw-password-field .show-password-input {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #888;
  padding: 4px;
  padding-top: 13px;
  line-height: 1;
  z-index: 2;
}
.ffw-password-field .show-password-input:hover {
  color: #555;
}
.ffw-password-field .show-password-input::after {
  font-size: 18px;
}

/* ── Options row – Remember me + Forgot password ── */
.ffw-login-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 22px;
  flex-wrap: wrap;
  gap: 8px;
}

.ffw-remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: #555;
  cursor: pointer;
  margin: 0;
  user-select: none;
}

.ffw-remember-me input[type="checkbox"] {
  margin: 0;
  accent-color: var(--wooPrimary, #13807d);
  width: 16px;
  height: 16px;
}

.ffw-forgot-password {
  font-size: 16px;
  font-weight: 400 !important;
  color: var(--wooPrimary, #13807d);
  text-decoration: none;
}

.ffw-forgot-password:hover {
  text-decoration: underline;
}

/* ── Submit button ── */
.ffw-login-submit-btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  font-size: var(--ffw-form-btn-size);
  font-weight: var(--ffw-form-btn-weight);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
  background: var(--wooPrimary, #13807d);
  border: none;
  border-radius: var(--ffw-form-btn-radius);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.1s ease;
  text-align: center;
  font-family: inherit;
}

.ffw-login-submit-btn:hover {
  background: var(--wooSecondary, #0e6563);
}

.ffw-login-submit-btn:active {
  transform: scale(0.98);
}

.ffw-login-submit-btn:focus {
  outline: 2px solid var(--wooSecondary, #0e6563);
  outline-offset: 2px;
}

/* ============================================
   Hide default WooCommerce my-account elements
   ============================================ */

/*
 * Hide the original custom_login_message() blue info box
 * (the one that immediately precedes our custom section).
 * Uses :has() to target only the sibling-info before our wrapper.
 */
.woocommerce-info:has(+ .ffw-myaccount-login-section),
.woocommerce-MyAccount-content > .woocommerce-info:first-child:has(+ .ffw-myaccount-login-section),
.woocommerce-account .woocommerce > .woocommerce-info:first-child:has(+ .ffw-myaccount-login-section),
.woocommerce-account .entry-content > .woocommerce-info:first-child:has(+ .ffw-myaccount-login-section) {
  display: none !important;
}

/*
 * Fallback for browsers that don't support :has()
 * (hides the first .woocommerce-info only when our section is present).
 * This is slightly broader but safe because the notice div injected by
 * custom_login_message() is always the very first child on the login page.
 */
.woocommerce-account .woocommerce > .woocommerce-info:first-child {
  display: none !important;
}


/* ============================================
   MY ACCOUNT REGISTER PAGE
   ============================================ */

/*
 * Register section – same outer styling as login section.
 */
.ffw-myaccount-register-section {
  border: 1px solid #e0e0e0;
  background: transparent;
  margin-top: 30px;
  padding: 40px 60px;
  box-sizing: border-box;
  width: 100%;
  overflow-x: hidden;
}

.ffw-myaccount-register-wrap {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.ffw-myaccount-register-col {
  width: 100%;
  box-sizing: border-box;
}

/* ── Form inputs must also use border-box ── */
.ffw-myaccount-register-form {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}
.ffw-myaccount-register-form *,
.ffw-myaccount-register-form *::before,
.ffw-myaccount-register-form *::after {
  box-sizing: border-box;
}

/* Override WooCommerce register form defaults */
.ffw-myaccount-register-form.register {
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}

/* reCAPTCHA + Register button side by side */
.ffw-myaccount-register-form .ffw-recaptcha-wrapper {
  flex: 0 0 auto;
  margin-right: 24px;
}

.ffw-myaccount-register-form .ffw-register-footer {
  flex: 1;
  min-width: 200px;
}

/* ── Register form grid rows ── */
.ffw-register-form-grid {
  display: flex;
  gap: 20px;
  margin-bottom: 0;
  width: 100%;
  max-width: 100%;
  flex: 0 0 100%;
}

/* Privacy policy checkbox: full width */
.ffw-myaccount-register-form .privacy-policy-checkbox {
  flex: 0 0 100%;
}

/* 3-column row: First Name | Last Name | Phone */
.ffw-register-row-3col .ffw-form-row {
  flex: 1;
  min-width: 0;
}

/* 2-column row: Username | Email (email wider) */
.ffw-register-row-2col-email .ffw-form-row {
  flex: 1;
  min-width: 0;
}
.ffw-register-row-2col-email .ffw-email-row {
  flex: 2;
}

/* 1-column row: Password */
.ffw-register-row-1col .ffw-form-row {
  flex: 1;
}

/* ── Register footer: reCAPTCHA + button ── */
.ffw-register-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-top: 8px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
}

.ffw-register-footer .ffw-register-submit-btn {
  flex: 1;
  min-width: 200px;
}

/* The reCAPTCHA widget is injected via woocommerce_register_form */
.ffw-myaccount-register-form .g-recaptcha,
.ffw-myaccount-register-form .grecaptcha-badge,
.ffw-myaccount-register-form #rc-imageselect,
.ffw-myaccount-register-form .rc-anchor {
  flex-shrink: 0;
}

/* reCAPTCHA responsive wrapper */
.ffw-recaptcha-wrapper {
  overflow: visible;
  max-width: 100%;
  display: inline-block;
  transform: scale(1.15);
  transform-origin: left top;
  margin-bottom: 12px;
}

.ffw-recaptcha-wrapper .g-recaptcha {
  transform-origin: left top;
}

/* ── Register submit button ── */
.ffw-register-submit-btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  font-size: var(--ffw-form-btn-size);
  font-weight: var(--ffw-form-btn-weight);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
  background: var(--wooPrimary, #13807d);
  border: none;
  border-radius: var(--ffw-form-btn-radius);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.1s ease;
  text-align: center;
  font-family: inherit;
}

.ffw-register-submit-btn:hover {
  background: var(--wooSecondary, #0e6563);
}

.ffw-register-submit-btn:active {
  transform: scale(0.98);
}

.ffw-register-submit-btn:focus {
  outline: 2px solid var(--wooSecondary, #0e6563);
  outline-offset: 2px;
}

/* ── Privacy policy checkbox (injected by add_privacy_policy_checkbox_myaccount) ── */
.ffw-myaccount-register-form .privacy-policy-checkbox {
  margin: 0 0 16px;
}
.ffw-myaccount-register-form .privacy-policy-checkbox label {
  font-size: var(--ffw-form-label-size);
  font-weight: var(--ffw-form-label-weight);
  color: var(--ffw-form-label-color);
  line-height: 1.5;
}
.ffw-myaccount-register-form .privacy-policy-checkbox input[type="checkbox"] {
  accent-color: var(--wooPrimary, #13807d);
}

/* ============================================
   LOST PASSWORD PAGE
   ============================================ */

.woocommerce-ResetPassword.lost_reset_password label {
  display: block;
  font-size: var(--ffw-form-label-size);
  font-weight: var(--ffw-form-label-weight);
  color: var(--ffw-form-label-color);
  margin-bottom: 6px;
}

.woocommerce-ResetPassword.lost_reset_password input.input-text {
  width: 100%;
  padding: 12px 14px;
  border: var(--ffw-form-input-border);
  border-radius: var(--ffw-form-input-radius);
  font-size: var(--ffw-form-input-size);
  color: var(--ffw-form-input-color);
  background: #fff;
  box-sizing: border-box;
  height: var(--ffw-form-input-height);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.woocommerce-ResetPassword.lost_reset_password input.input-text:focus {
  outline: none;
  border-color: var(--wooPrimary, #13807d);
  box-shadow: 0 0 0 3px rgba(var(--wooPrimary-rgb, 0, 174, 215), 0.12);
}

.woocommerce-ResetPassword.lost_reset_password input.input-text::placeholder {
  color: #999;
  opacity: 1;
}

.woocommerce-ResetPassword.lost_reset_password .form-row {
  margin: 0 0 18px;
}

.woocommerce-ResetPassword.lost_reset_password button.woocommerce-Button.button {
  display: inline-block;
  width: auto;
  padding: 14px 32px;
  font-size: var(--ffw-form-btn-size);
  font-weight: var(--ffw-form-btn-weight);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff !important;
  background: var(--wooPrimary, #13807d) !important;
  border: none !important;
  border-radius: var(--ffw-form-btn-radius) !important;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.1s ease;
  text-align: center;
  font-family: inherit;
  margin-top: 8px;
}

.woocommerce-ResetPassword.lost_reset_password button.woocommerce-Button.button:hover {
  background: var(--wooSecondary, #0e6563) !important;
}

.woocommerce-ResetPassword.lost_reset_password button.woocommerce-Button.button:active {
  transform: scale(0.98);
}

/* ============================================
   EDIT ACCOUNT PAGE – Form field styling
   ============================================ */

.woocommerce-EditAccountForm.edit-account .form-row {
  margin: 0 0 18px;
}

.woocommerce-EditAccountForm.edit-account label {
  display: block;
  font-size: var(--ffw-form-label-size);
  font-weight: var(--ffw-form-label-weight);
  color: var(--ffw-form-label-color);
  margin-bottom: 6px;
}

.woocommerce-EditAccountForm.edit-account input.input-text {
  width: 100%;
  padding: 12px 14px;
  border: var(--ffw-form-input-border);
  border-radius: var(--ffw-form-input-radius);
  font-size: var(--ffw-form-input-size);
  color: var(--ffw-form-input-color);
  background: #fff;
  box-sizing: border-box;
  height: var(--ffw-form-input-height);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.woocommerce-EditAccountForm.edit-account input.input-text:focus {
  outline: none;
  border-color: var(--wooPrimary, #13807d);
  box-shadow: 0 0 0 3px rgba(var(--wooPrimary-rgb, 0, 174, 215), 0.12);
}

.woocommerce-EditAccountForm.edit-account input.input-text::placeholder {
  color: #999;
  opacity: 1;
}

/* Password field wrapper */
.woocommerce-EditAccountForm.edit-account .password-input {
  position: relative;
  display: block;
}

/* Password visibility eye */
.woocommerce-EditAccountForm.edit-account .show-password-input {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
}

/* Fieldset legend */
.woocommerce-EditAccountForm.edit-account fieldset {
  margin-top: 24px;
  padding: 0;
  border: none;
}

.woocommerce-EditAccountForm.edit-account fieldset legend {
  font-size: 18px;
  font-weight: 700;
  color: #000;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e5e5;
  width: 100%;
}

/* Save changes button */
.woocommerce-EditAccountForm.edit-account button.woocommerce-Button.button {
  display: inline-block;
  width: auto;
  padding: 14px 32px;
  font-size: var(--ffw-form-btn-size);
  font-weight: var(--ffw-form-btn-weight);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff !important;
  background: var(--wooPrimary, #13807d) !important;
  border: none !important;
  border-radius: var(--ffw-form-btn-radius) !important;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.1s ease;
  text-align: center;
  font-family: inherit;
  margin-top: 8px;
}

.woocommerce-EditAccountForm.edit-account button.woocommerce-Button.button:hover {
  background: var(--wooSecondary, #0e6563) !important;
}

.woocommerce-EditAccountForm.edit-account button.woocommerce-Button.button:active {
  transform: scale(0.98);
}

/* ============================================
   EDIT BILLING / SHIPPING ADDRESS PAGE – Form styling
   ============================================ */

.woocommerce-address-fields .form-row {
  margin: 0 0 18px;
}

.woocommerce-address-fields label {
  display: block;
  font-size: var(--ffw-form-label-size);
  font-weight: var(--ffw-form-label-weight);
  color: var(--ffw-form-label-color);
  margin-bottom: 6px;
}

.woocommerce-address-fields input.input-text,
.woocommerce-address-fields select {
  width: 100%;
  padding: 12px 14px;
  border: var(--ffw-form-input-border);
  border-radius: var(--ffw-form-input-radius);
  font-size: var(--ffw-form-input-size);
  color: var(--ffw-form-input-color);
  background: #fff;
  box-sizing: border-box;
  height: var(--ffw-form-input-height);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.woocommerce-address-fields .select2-container .select2-selection--single {
  height: var(--ffw-form-input-height) !important;
  border: var(--ffw-form-input-border) !important;
  border-radius: var(--ffw-form-input-radius) !important;
  display: flex;
  align-items: center;
  padding-left: 4px;
}

.woocommerce-address-fields .select2-container .select2-selection--single .select2-selection__arrow {
  height: var(--ffw-form-input-height) !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

.woocommerce-address-fields input.input-text:focus,
.woocommerce-address-fields select:focus {
  outline: none;
  border-color: var(--wooPrimary, #13807d);
  box-shadow: 0 0 0 3px rgba(var(--wooPrimary-rgb, 0, 174, 215), 0.12);
}

.woocommerce-address-fields input.input-text::placeholder {
  color: #999;
  opacity: 1;
}

.woocommerce-address-fields h3 {
  font-size: 18px;
  font-weight: 700;
  color: #000;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e5e5;
}

.woocommerce-address-fields button.button {
  display: inline-block;
  width: auto;
  padding: 14px 32px;
  font-size: var(--ffw-form-btn-size);
  font-weight: var(--ffw-form-btn-weight);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff !important;
  background: var(--wooPrimary, #13807d) !important;
  border: none !important;
  border-radius: var(--ffw-form-btn-radius) !important;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.1s ease;
  text-align: center;
  font-family: inherit;
  margin-top: 8px;
}

.woocommerce-address-fields button.button:hover {
  background: var(--wooSecondary, #0e6563) !important;
}

.woocommerce-address-fields button.button:active {
  transform: scale(0.98);
}

/* ============================================
   MY ACCOUNT – Addresses overview (Billing / Shipping)
   ============================================ */

.woocommerce-Addresses.u-columns.col2-set {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin-top: 16px;
}

.woocommerce-Addresses .u-column1,
.woocommerce-Addresses .u-column2 {
  flex: 1 1 0;
  min-width: 0;
}

.woocommerce-Addresses .woocommerce-Address-title.title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.woocommerce-Addresses .woocommerce-Address-title.title h3 {
  font-size: 18px;
  font-weight: 700;
  color: #000;
  margin: 0;
}

.woocommerce-Addresses .woocommerce-Address-title.title a.edit {
  font-size: 16px;
  font-weight: 600;
  color: var(--wooPrimary, #13807d);
  text-decoration: none;
  white-space: nowrap;
}

.woocommerce-Addresses .woocommerce-Address-title.title a.edit:hover {
  text-decoration: underline;
}

.woocommerce-Addresses address {
  font-style: normal;
  font-size: 16px;
  color: #333;
  line-height: 1.6;
}
