/* =============================================================
   AskPerTask Login / Register — apt-login-register.css

   Scope:
   • body.hp-template--user-login-page  — /login page layout
   • .hp-form--user-login               — login form (page + modal)
   • .hp-form--user-register            — register modal form
   • #user_login_modal / #user_register_modal — FancyBox modal sizing

   Loaded on every frontend page because the login/register modals
   are injected into the site footer and can open on any page.
   All selectors are narrow enough to avoid affecting other forms.
   ============================================================= */

/* ---- Design tokens ---- */
:root {
  --apt-lr-green:        #1FA34A;
  --apt-lr-green-dark:   #168238;
  --apt-lr-green-light:  #EAF7EE;
  --apt-lr-blue:         #2D6CDF;
  --apt-lr-blue-light:   #EAF1FD;
  --apt-lr-text:         #1A1A1A;
  --apt-lr-muted:        #6B7280;
  --apt-lr-muted-light:  #9CA3AF;
  --apt-lr-border:       #E5E7EB;
  --apt-lr-bg-page:      #F4F5F7;
  --apt-lr-white:        #FFFFFF;
  --apt-lr-radius:       8px;
  --apt-lr-radius-lg:    16px;
  --apt-lr-input-h:      48px;
  --apt-lr-btn-h:        52px;
  --apt-lr-shadow:       0 2px 12px rgba(16, 24, 40, 0.07);
}

/* ============================================================
   LOGIN PAGE — grey background + white card
   ============================================================ */

body.hp-template--user-login-page {
  background-color: var(--apt-lr-bg-page);
}

body.hp-template--user-login-page .page__text {
  max-width: none !important;
  margin: 0 !important;
  padding: 48px 16px 80px;
  min-height: 60vh;
  background: var(--apt-lr-bg-page);
}

body.hp-template--user-login-page .hp-page {
  background: transparent;
  overflow-x: hidden;
}

/* Hide breadcrumb on the login page */
body.hp-template--user-login-page .hp-menu--breadcrumb {
  display: none;
}

/* Page title — replaced by JS with "Welcome back" */
body.hp-template--user-login-page .hp-page__title {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--apt-lr-text);
  text-align: center;
  margin: 0 0 6px;
  line-height: 1.25;
}

/* Subtitle injected by JS */
.apt-lr-subtitle {
  text-align: center;
  font-size: 0.9375rem;
  color: var(--apt-lr-muted);
  margin: 0 0 24px;
}

/* White card wrapper around the page-embedded login form */
body.hp-template--user-login-page .hp-form--user-login {
  background: var(--apt-lr-white);
  border-radius: var(--apt-lr-radius-lg);
  border: 1px solid var(--apt-lr-border);
  box-shadow: var(--apt-lr-shadow);
  padding: 36px 40px;
  max-width: 440px;
  margin: 0 auto;
}

/* ============================================================
   EMAIL VERIFICATION PAGE — /account/verify-email/
   (APT-AUTH-REQUEST-FLOW-VISUAL-1A)

   Same grey-page + white-card shell as the login page above, reused
   here since HivePress renders this route through the same
   Page_Narrow "hp-page__content" markup. Core's own success copy
   (user-email-verify-message.php) becomes the card body untouched —
   this is visual polish only, no message text is changed here.
   ============================================================ */

body.hp-template--user-email-verify-page {
  background-color: var(--apt-lr-bg-page);
}

body.hp-template--user-email-verify-page .page__text {
  max-width: none !important;
  margin: 0 !important;
  padding: 48px 16px 80px;
  min-height: 60vh;
  background: var(--apt-lr-bg-page);
}

body.hp-template--user-email-verify-page .hp-page {
  background: transparent;
  overflow-x: hidden;
}

body.hp-template--user-email-verify-page .hp-menu--breadcrumb {
  display: none;
}

body.hp-template--user-email-verify-page .hp-page__content {
  background: var(--apt-lr-white);
  border-radius: var(--apt-lr-radius-lg);
  border: 1px solid var(--apt-lr-border);
  box-shadow: var(--apt-lr-shadow);
  padding: 40px;
  max-width: 440px;
  margin: 0 auto;
  text-align: center;
}

body.hp-template--user-email-verify-page .hp-page__title {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--apt-lr-text);
  margin: 0 0 12px;
  line-height: 1.25;
}

body.hp-template--user-email-verify-page .hp-page__content p {
  font-size: 0.9375rem;
  color: var(--apt-lr-muted);
  line-height: 1.6;
  margin: 0 0 24px;
}

body.hp-template--user-email-verify-page .hp-page__content .button {
  display: inline-block;
  background: var(--apt-lr-green);
  color: var(--apt-lr-white);
  border: none;
  border-radius: var(--apt-lr-radius);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0 28px;
  height: var(--apt-lr-input-h);
  line-height: var(--apt-lr-input-h);
  cursor: pointer;
}

body.hp-template--user-email-verify-page .hp-page__content .button:hover {
  background: var(--apt-lr-green-dark);
}

@media (max-width: 640px) {
  body.hp-template--user-email-verify-page .hp-page__content {
    padding: 28px 20px;
    border-radius: 12px;
  }
}

/* ============================================================
   MODAL SIZING
   FancyBox moves #user_register_modal / #user_login_modal into
   .fancybox-content. Setting max-width here controls popup width.
   ============================================================ */

#user_register_modal,
#user_login_modal,
#user_password_request_modal {
  max-width: 440px;
  width: 100%;
  box-sizing: border-box;
}

/* ============================================================
   MODAL TITLES
   ============================================================ */

#user_register_modal .hp-modal__title,
#user_login_modal .hp-modal__title,
#user_password_request_modal .hp-modal__title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--apt-lr-text);
  text-align: center;
  margin: 0 0 24px;
  line-height: 1.25;
}

/* ============================================================
   FORM MESSAGES (error / success)
   ============================================================ */

.hp-form--user-login .hp-form__messages,
.hp-form--user-register .hp-form__messages,
.hp-form--user-password-request .hp-form__messages {
  border-radius: var(--apt-lr-radius);
  padding: 12px 16px;
  font-size: 0.875rem;
  margin-bottom: 20px;
}

.hp-form--user-login .hp-form__messages--error,
.hp-form--user-register .hp-form__messages--error,
.hp-form--user-password-request .hp-form__messages--error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #B91C1C;
}

.hp-form--user-login .hp-form__messages--success,
.hp-form--user-register .hp-form__messages--success,
.hp-form--user-password-request .hp-form__messages--success {
  background: var(--apt-lr-green-light);
  border: 1px solid #A7F3C3;
  color: var(--apt-lr-green-dark);
}

/* ============================================================
   REGISTER SUCCESS — countdown line injected by apt-login-register.js
   (APT-AUTH-REQUEST-FLOW-VISUAL-1A)
   ============================================================ */

.apt-lr-countdown {
  margin-top: 8px;
  font-size: 0.8125rem;
  color: var(--apt-lr-muted);
}

.apt-lr-countdown a {
  color: var(--apt-lr-green);
  font-weight: 600;
  text-decoration: underline;
}

/* ============================================================
   SOCIAL LOGIN — header section
   Injected by hivepress-social-login plugin into .hp-form__header
   ============================================================ */

.hp-form--user-login .hp-form__header,
.hp-form--user-register .hp-form__header {
  margin-bottom: 0;
}

/* Google "Continue with Google" button */
.hp-form--user-login .hp-social-links .gsi-material-button,
.hp-form--user-register .hp-social-links .gsi-material-button {
  height: var(--apt-lr-input-h) !important;
  border-radius: var(--apt-lr-radius) !important;
  border: 1.5px solid var(--apt-lr-border) !important;
  font-family: inherit !important;
  font-size: 0.9375rem !important;
  font-weight: 500 !important;
  width: 100% !important;
  margin-bottom: 0 !important;
}

.hp-form--user-login .hp-social-links .gsi-material-button:hover,
.hp-form--user-register .hp-social-links .gsi-material-button:hover {
  border-color: #D1D5DB !important;
}

/* Other provider buttons (circular → full-width pill style) */
.hp-form--user-login .hp-social-links .hp-social-links__item:not(.button),
.hp-form--user-register .hp-social-links .hp-social-links__item:not(.button) {
  border-radius: var(--apt-lr-radius);
  width: 100%;
  height: var(--apt-lr-input-h);
  margin-right: 0 !important;
  margin-bottom: 0;
  font-size: 0.9375rem;
  font-weight: 500;
}

.hp-form--user-login .hp-social-links .hp-social-links__item:not(.button) span,
.hp-form--user-register .hp-social-links .hp-social-links__item:not(.button) span {
  display: inline !important;
  margin-left: 8px;
}

.hp-form--user-login .hp-social-links,
.hp-form--user-register .hp-social-links {
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0;
}

/* OR divider injected by JS between social login and email/password */
.apt-lr-or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--apt-lr-muted-light);
  font-size: 0.8125rem;
}

.apt-lr-or-divider::before,
.apt-lr-or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--apt-lr-border);
}

.apt-lr-or-divider span {
  white-space: nowrap;
}

/* ============================================================
   FORM FIELDS — shared input styling
   ============================================================ */

.hp-form--user-login .hp-form__fields,
.hp-form--user-register .hp-form__fields,
.hp-form--user-password-request .hp-form__fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hp-form--user-login .hp-form__field,
.hp-form--user-register .hp-form__field,
.hp-form--user-password-request .hp-form__field {
  margin-bottom: 0;
}

/* Field labels */
.hp-form--user-login .hp-field__label,
.hp-form--user-register .hp-field__label,
.hp-form--user-password-request .hp-field__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--apt-lr-text);
  margin-bottom: 6px;
}

/* Text, email, password inputs */
.hp-form--user-login input[type="text"],
.hp-form--user-login input[type="email"],
.hp-form--user-login input[type="password"],
.hp-form--user-register input[type="text"],
.hp-form--user-register input[type="email"],
.hp-form--user-register input[type="password"],
.hp-form--user-password-request input[type="text"],
.hp-form--user-password-request input[type="email"] {
  height: var(--apt-lr-input-h);
  padding: 0 14px;
  border: 1.5px solid var(--apt-lr-border);
  border-radius: var(--apt-lr-radius);
  font-size: 0.9375rem;
  color: var(--apt-lr-text);
  background: var(--apt-lr-white);
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.hp-form--user-login input[type="text"]:focus,
.hp-form--user-login input[type="email"]:focus,
.hp-form--user-login input[type="password"]:focus,
.hp-form--user-register input[type="text"]:focus,
.hp-form--user-register input[type="email"]:focus,
.hp-form--user-register input[type="password"]:focus,
.hp-form--user-password-request input[type="text"]:focus,
.hp-form--user-password-request input[type="email"]:focus {
  outline: none;
  border-color: var(--apt-lr-blue);
  box-shadow: 0 0 0 3px rgba(45, 108, 223, 0.14);
}

/* Password field — account for the show/hide toggle icon */
.hp-form--user-login .hp-field--password input[type="password"],
.hp-form--user-register .hp-field--password input[type="password"] {
  padding-right: 46px;
}

/* Show/hide toggle icon */
.hp-form--user-login .hp-field--password .hp-field__icon,
.hp-form--user-register .hp-field--password .hp-field__icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--apt-lr-muted);
  font-size: 0.875rem;
  line-height: 1;
  z-index: 1;
  cursor: pointer;
}

.hp-form--user-login .hp-field--password,
.hp-form--user-register .hp-field--password {
  position: relative;
}

/* Field validation error */
.hp-form--user-login .hp-field--invalid input,
.hp-form--user-register .hp-field--invalid input {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.hp-form--user-login .hp-field__error,
.hp-form--user-register .hp-field__error {
  font-size: 0.8125rem;
  color: #B91C1C;
  margin-top: 4px;
}

/* ============================================================
   TERMS CHECKBOX
   ============================================================ */

.hp-form--user-register .hp-field--checkbox .hp-field__label {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--apt-lr-muted);
}

.hp-form--user-register .hp-field--checkbox .hp-field__label a {
  color: var(--apt-lr-blue);
  font-weight: 500;
  text-decoration: none;
}

.hp-form--user-register .hp-field--checkbox .hp-field__label a:hover {
  text-decoration: underline;
}

/* ============================================================
   FORM FOOTER — submit button + action links
   ============================================================ */

.hp-form--user-login .hp-form__footer,
.hp-form--user-register .hp-form__footer,
.hp-form--user-password-request .hp-form__footer {
  margin-top: 20px;
}

/* Submit button — full-width green */
.hp-form--user-login .hp-form__button,
.hp-form--user-register .hp-form__button,
.hp-form--user-password-request .hp-form__button {
  display: block;
  width: 100%;
  height: var(--apt-lr-btn-h);
  background: var(--apt-lr-green);
  color: var(--apt-lr-white);
  border: none;
  border-radius: var(--apt-lr-radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 0.2s ease;
  line-height: var(--apt-lr-btn-h);
  padding: 0;
}

.hp-form--user-login .hp-form__button:hover,
.hp-form--user-register .hp-form__button:hover,
.hp-form--user-password-request .hp-form__button:hover {
  background: var(--apt-lr-green-dark);
}

/* Footer action links (register link, forgot password, etc.) */
.hp-form--user-login .hp-form__actions:not(:first-child),
.hp-form--user-register .hp-form__actions:not(:first-child),
.hp-form--user-password-request .hp-form__actions:not(:first-child) {
  margin-top: 16px;
  text-align: center;
}

.hp-form--user-login .hp-form__action,
.hp-form--user-register .hp-form__action,
.hp-form--user-password-request .hp-form__action {
  display: block;
  font-size: 0.875rem;
  color: var(--apt-lr-muted);
  line-height: 1.5;
}

.hp-form--user-login .hp-form__action a,
.hp-form--user-register .hp-form__action a,
.hp-form--user-password-request .hp-form__action a {
  color: var(--apt-lr-blue);
  font-weight: 600;
  text-decoration: none;
}

.hp-form--user-login .hp-form__action a:hover,
.hp-form--user-register .hp-form__action a:hover,
.hp-form--user-password-request .hp-form__action a:hover {
  text-decoration: underline;
}

/* Forgot password link — smaller, secondary style */
.hp-form__action--user-password-request {
  font-size: 0.8125rem !important;
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 640px) {
  body.hp-template--user-login-page .hp-form--user-login {
    padding: 28px 20px;
    border-radius: 12px;
  }

  #user_register_modal,
  #user_login_modal,
  #user_password_request_modal {
    max-width: 100%;
  }
}
