/*
 * /login/ page polish. Loaded only on the login page, scoped to body.po-account-page.
 * Styles the existing Elementor nested tabs and WPForms forms without changing them.
  *
 * The "card" is the Login/Register tabs widget on /login/, and the shortcode widget holding
 * the WPForms reset form on /reset-password/ (body.po-reset-page).
 */
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  padding: 24px 28px 28px;
  box-sizing: border-box;
}

/* Login / Register: account-page.js hides the tab buttons and switches with a link under each form
   (body.po-tabs-as-links). Without JavaScript the Elementor tabs stay, styled as plain underlined tabs. */
.po-account-page.po-tabs-as-links .e-n-tabs-heading,
.po-account-page.po-tabs-as-links .e-n-tab-title {
  display: none !important;
}
.po-account-page .e-n-tabs-heading {
  display: flex;
  border-bottom: 1px solid #e3ebe5;
  margin-bottom: 20px;
}
.po-account-page .e-n-tab-title {
  flex: 1 1 0;
  justify-content: center;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  padding: 10px 16px !important;
  background: transparent !important;
  color: #5b7564 !important;
  font-weight: 600;
}
.po-account-page .e-n-tab-title[aria-selected="true"] {
  border-bottom-color: #00793f !important;
  color: #00793f !important;
}
.po-account-switch {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid #e3ebe5;
  text-align: center;
  font-size: 14px;
  color: #1f3b2c;
}
.po-account-page .po-account-switch button {
  display: inline;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  color: #00793f !important;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* Remove the empty space around the forms */
.po-account-page .e-n-tabs-content > .e-con {
  padding: 0 !important;
}
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) .wpforms-container {
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
}
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) .wpforms-head-container {
  display: none;
}

/* Fields: full width (some fields are set to "medium" in WPForms), no auto-hyphenation */
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode),
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) * {
  -webkit-hyphens: manual !important;
  hyphens: manual !important;
}
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) .wpforms-field-row,
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) .wpforms-field .choices {
  width: 100% !important;
  max-width: none !important;
}
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) .choices__inner {
  border: 1px solid #cfd8d1 !important;
  border-radius: 10px !important;
  min-height: 44px;
  background: #fff !important;
  box-sizing: border-box;
}
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) .wpforms-field {
  padding: 8px 0 !important;
}
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) .wpforms-field-label {
  margin-bottom: 6px;
}
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) .wpforms-field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) .wpforms-field select,
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) .wpforms-field textarea {
  width: 100% !important;
  max-width: none !important;
  border: 1px solid #cfd8d1 !important;
  border-radius: 10px !important;
  padding: 10px 12px !important;
  min-height: 44px;
  box-sizing: border-box;
}
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) .wpforms-field input:focus,
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) .wpforms-field select:focus,
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) .wpforms-field textarea:focus {
  border-color: #00793f !important;
  box-shadow: 0 0 0 3px rgba(0, 121, 63, 0.15) !important;
  outline: none;
}
/* "Remember me" was shown twice (field label + checkbox label) */
.po-account-page .po-login-form .wpforms-field-checkbox > .wpforms-field-label {
  display: none;
}

/* Submit button + a small spinner inside it instead of WPForms' separate spinner image */
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) .wpforms-submit-container {
  padding-top: 12px !important;
}
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) .wpforms-submit {
  width: 100% !important;
  min-height: 48px;
  border: 0 !important;
  border-radius: 10px !important;
  background: #00793f !important;
  color: #fff !important;
  font-weight: 600 !important;
  cursor: pointer;
}
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) .wpforms-submit:hover {
  background: #00632f !important;
}
.po-account-page .wpforms-submit-spinner {
  display: none !important;
}
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) .wpforms-submit[disabled] {
  opacity: 0.9 !important;
  cursor: progress;
}
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) .wpforms-submit[disabled]::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 10px;
  vertical-align: -3px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: po-account-spin 0.7s linear infinite;
}
@keyframes po-account-spin {
  to { transform: rotate(360deg); }
}

/* "Forgot Password" as a small link instead of a big grey block */
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) .elementor-widget:has(a[href*="reset-password"]:not(.po-forgot-link)) {
  text-align: center;
  margin-top: 20px !important;
}
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) a[href*="reset-password"]:not(.po-forgot-link) {
  display: inline !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-height: 0 !important;
  color: #00793f !important;
  font-size: 14px !important;
  text-decoration: underline;
}
.po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) a[href*="reset-password"]:not(.po-forgot-link) * {
  background: none !important;
  padding: 0 !important;
  color: inherit !important;
  font-size: inherit !important;
}

/* Notes added by account-page.js */
.po-account-note {
  background: #eef4ef;
  color: #1f3b2c;
  border-radius: 10px;
  padding: 10px 14px;
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.45;
}

@media (max-width: 600px) {
  .po-account-page :is(.elementor-widget-n-tabs, .po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode) {
    padding: 18px 16px 22px;
    border-radius: 12px;
  }
}

/* Debug line (an Elementor Shortcode widget printing the render time and user) under the forms.
   Hidden for visitors; it stays in the page source. Delete the widget in Elementor to remove it fully. */
.po-account-page .elementor-element-bb38312 {
  display: none !important;
}

/* /reset-password/: heading, note and "Back to login" added by account-page.js */
/* The shortcode widget has its own 88px padding set in Elementor; the card provides the spacing. */
.po-reset-page [data-elementor-type="wp-page"] .elementor-widget-shortcode > .elementor-widget-container {
  padding: 0 !important;
}
.po-account-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #eef4ef;
  color: #00793f;
}
.po-account-icon svg {
  width: 28px;
  height: 28px;
}
.po-account-title {
  margin: 0 0 12px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  color: #1f3b2c;
}
.po-account-back-wrap {
  margin: 20px 0 0;
  text-align: center;
}
.po-account-back {
  color: #00793f !important;
  font-size: 14px;
  text-decoration: underline;
}

/* Login extras added by account-page.js: forgot link on the "Remember me" row, show/hide password */
.po-account-page .elementor-widget.po-moved {
  display: none !important;
}
.po-account-page .po-remember-row {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
.po-account-page .po-remember-row fieldset {
  margin: 0;
}
.po-forgot-link {
  color: #00793f !important;
  font-size: 14px;
  text-decoration: underline;
  white-space: nowrap;
}
.po-account-page .po-pw-wrap {
  position: relative !important;
  display: block !important;
}
.po-account-page .po-pw-wrap input {
  padding-right: 46px !important;
}
.po-account-page .po-pw-toggle {
  position: absolute !important;
  top: 0 !important;
  right: 4px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 40px !important;
  height: 44px !important;
  z-index: 3; /* WPForms gives the input position:relative + z-index:2 */
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #5b7564 !important;
  cursor: pointer;
}
.po-account-page .po-pw-toggle:hover,
.po-account-page .po-pw-toggle[aria-pressed="true"] {
  color: #00793f !important;
}
.po-pw-toggle svg {
  width: 20px;
  height: 20px;
}
