/* ============================================================
   Faith Radar – Auth Forms
   
   Strategy: use `body .fr-auth-wrap` prefix throughout so our
   rules are always more specific than Elementor's generic
   selectors. !important only on properties Elementor hardcodes
   (button bg, input border, font-family).
   ============================================================ */

/* ── Wrapper — centered inside any Elementor column ─────────── */
body .fr-auth-wrap {
    max-width: 480px;
    width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
    font-family: var(--psk-font, inherit) !important;
    box-sizing: border-box;
}

/* ── Form layout ─────────────────────────────────────────────── */
body .fr-auth-wrap .fr-auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

body .fr-auth-wrap .fr-auth-row--2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 480px) {
    body .fr-auth-wrap .fr-auth-row--2 {
        grid-template-columns: 1fr;
    }
}

/* ── Field wrappers ──────────────────────────────────────────── */
body .fr-auth-wrap .fr-auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ── Labels ──────────────────────────────────────────────────── */
body .fr-auth-wrap .fr-auth-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 13px;
    font-weight: 600;
    color: var(--psk-text, #1a1a2e);
    letter-spacing: 0.01em;
    margin: 0;
}

body .fr-auth-wrap .fr-auth-label-link {
    font-size: 12px;
    font-weight: 400;
    color: var(--e-global-color-accent, var(--psk-primary, #4a6cf7));
    text-decoration: none;
}

body .fr-auth-wrap .fr-auth-label-link:hover {
    text-decoration: underline;
}

/* ── Inputs — override Elementor's form reset ────────────────── */
body .fr-auth-wrap input.fr-auth-input,
body .fr-auth-wrap .fr-auth-input {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    height: 44px !important;
    padding: 0 12px !important;
    border: 1.5px solid var(--psk-border, #d8dce3) !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-family: inherit !important;
    color: var(--psk-text, #1a1a2e) !important;
    background: var(--psk-surface, #ffffff) !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
    margin: 0 !important;
}

body .fr-auth-wrap input.fr-auth-input:focus,
body .fr-auth-wrap .fr-auth-input:focus {
    border-color: var(--psk-primary, #4a6cf7) !important;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.13) !important;
}

body .fr-auth-wrap .fr-auth-input.fr-auth-input--error {
    border-color: #c0392b !important;
}

/* Password input needs right padding for the toggle btn */
body .fr-auth-wrap .fr-auth-pw-wrap .fr-auth-input {
    padding-right: 44px !important;
}

/* Non-password inputs: no extra right padding */
body .fr-auth-wrap .fr-auth-field > .fr-auth-input {
    padding-right: 12px !important;
}

/* ── Password wrapper ────────────────────────────────────────── */
body .fr-auth-wrap .fr-auth-pw-wrap {
    position: relative;
    overflow: visible !important;
}

body .fr-auth-wrap .fr-auth-pw-toggle,
html body .fr-auth-pw-toggle {
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 6px !important;
    margin: 0 !important;
    cursor: pointer !important;
    color: var(--psk-text-muted, #8b95a2) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
    outline: none !important;
    min-height: 0 !important;
    height: auto !important;
    width: auto !important;
    min-width: 0 !important;
    line-height: 1 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    pointer-events: all !important;
    z-index: 10;
    transition: color 0.15s;
}
body .fr-auth-wrap .fr-auth-pw-toggle:hover,
html body .fr-auth-pw-toggle:hover {
    color: var(--psk-text, #1a1a2e) !important;
    background: none !important;
    background-color: transparent !important;
}
/* Stop SVG from swallowing pointer events before they reach the button */
body .fr-auth-wrap .fr-auth-pw-toggle svg {
    pointer-events: none;
    display: block;
}

/* ── Remember me checkbox ────────────────────────────────────── */
body .fr-auth-wrap .fr-auth-remember {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    color: var(--psk-text-muted, #666e7a);
    cursor: pointer;
    user-select: none;
    margin: 0;
}

body .fr-auth-wrap .fr-auth-remember input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    accent-color: var(--psk-primary, #4a6cf7);
    cursor: pointer;
    flex-shrink: 0;
    margin: 0 !important;
}

/* ── Submit button — override Elementor completely ───────────── */
/*
   Elementor applies button styles via .elementor-button and
   global color CSS variables. We use body + three selectors and
   !important on the critical properties so our button always wins
   regardless of which Elementor global color is active.
*/
body .fr-auth-wrap .fr-auth-btn,
body .fr-auth-wrap button.fr-auth-btn,
html body .fr-auth-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 46px !important;
    min-height: 46px !important;
    padding: 0 24px !important;
    background-color: var(--psk-primary, #4a6cf7) !important;
    background-image: none !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    letter-spacing: 0.01em;
    cursor: pointer;
    text-decoration: none !important;
    box-shadow: none !important;
    transition: filter 0.15s;
    -webkit-appearance: none;
    appearance: none;
    margin: 0 !important;
}

body .fr-auth-wrap .fr-auth-btn:hover,
html body .fr-auth-btn:hover {
    filter: brightness(1.1);
    background-color: var(--psk-primary, #4a6cf7) !important;
    color: #ffffff !important;
}

body .fr-auth-wrap .fr-auth-btn:disabled,
html body .fr-auth-btn:disabled {
    opacity: 0.58;
    cursor: not-allowed;
    filter: none;
}

/* ── Field-level error messages ──────────────────────────────── */
body .fr-auth-wrap .fr-auth-field-error {
    font-size: 12px;
    color: #c0392b;
    min-height: 14px;
    line-height: 1.4;
    margin: 0;
}

/* ── Form-level error ────────────────────────────────────────── */
body .fr-auth-wrap .fr-auth-form-error {
    padding: 11px 14px;
    background: #fcebeb;
    border: 1px solid #f7c1c1;
    border-radius: 8px;
    font-size: 13px;
    color: #791f1f;
    line-height: 1.5;
    margin: 0;
}

/* ── Footer link (already have account, etc.) ────────────────── */
body .fr-auth-wrap .fr-auth-footer-link {
    text-align: center;
    font-size: 13px;
    color: var(--psk-text-muted, #666e7a);
    margin: 4px 0 0;
}

body .fr-auth-wrap .fr-auth-footer-link a {
    color: var(--psk-primary, #4a6cf7);
    text-decoration: none;
    font-weight: 500;
}

body .fr-auth-wrap .fr-auth-footer-link a:hover {
    text-decoration: underline;
}

/* ── Notice boxes (verify pending, URL error messages) ───────── */
body .fr-auth-notice {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    margin-bottom: 20px;
}

body .fr-auth-notice--info    { background: #e6f1fb; border-color: #b5d4f4; }
body .fr-auth-notice--success { background: #e1f5ee; border-color: #9fe1cb; }
body .fr-auth-notice--error   { background: #fcebeb; border-color: #f7c1c1; }

body .fr-auth-notice .fr-auth-notice__icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

body .fr-auth-notice .fr-auth-notice__body {
    flex: 1;
    font-size: 14px;
    line-height: 1.65;
    color: var(--psk-text, #1a1a2e);
}

body .fr-auth-notice .fr-auth-notice__body strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

body .fr-auth-notice .fr-auth-notice__body p {
    margin: 6px 0 0;
}

body .fr-auth-notice .fr-auth-notice__body a {
    color: var(--psk-primary, #4a6cf7);
    font-weight: 500;
}

/* ============================================================
   Welcome forms + Church Registration additions
   ============================================================ */

/* ── Welcome form intro ─────────────────────────────────────── */
body .fr-auth-wrap.fr-welcome-wrap { max-width: 560px; }
body .fr-welcome-wrap .fr-welcome-intro {
    font-size: 14px;
    color: var(--psk-text-muted, #666e7a);
    margin: 0 0 24px;
    line-height: 1.6;
}

/* ── Optional label suffix ──────────────────────────────────── */
body .fr-auth-wrap .fr-label-optional {
    font-size: 11px;
    font-weight: 400;
    color: var(--psk-text-muted, #8b95a2);
    margin-left: 4px;
}

/* ── Select inputs (reuse fr-auth-input look) ───────────────── */
body .fr-auth-wrap select.fr-auth-input,
body .fr-auth-wrap .fr-auth-select {
    height: 44px !important;
    padding: 0 36px 0 12px !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b95a2' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    cursor: pointer !important;
}

/* ── Textarea ───────────────────────────────────────────────── */
body .fr-auth-wrap textarea.fr-auth-input,
body .fr-auth-wrap .fr-auth-textarea {
    height: auto !important;
    padding: 10px 12px !important;
    resize: vertical;
    min-height: 148px;   /* comfortable for a short bio — ~6 lines */
    line-height: 1.6 !important;
}

/* ── Field hint text ────────────────────────────────────────── */
body .fr-auth-wrap .fr-field-hint {
    font-size: 12px;
    color: var(--psk-text-muted, #8b95a2);
    margin: 4px 0 0;
}

/* ── Avatar upload ──────────────────────────────────────────── */
body .fr-welcome-wrap .fr-welcome-avatar-field { margin-bottom: 4px; }

body .fr-welcome-wrap .fr-avatar-upload {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    border: 1.5px dashed var(--psk-border, #d8dce3);
    border-radius: 8px;
    background: var(--psk-bg, #f8f9fa);
}

body .fr-welcome-wrap .fr-avatar-preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--psk-border, #d8dce3);
}

body .fr-welcome-wrap .fr-avatar-preview img,
body .fr-welcome-wrap .fr-avatar-img {
    width: 72px !important;
    height: 72px !important;
    object-fit: cover;
    border-radius: 50%;
}

body .fr-welcome-wrap .fr-avatar-controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

body .fr-welcome-wrap .fr-avatar-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Secondary button style */
body .fr-auth-wrap .fr-btn--secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 16px;
    border: 1.5px solid var(--psk-border, #d8dce3);
    border-radius: 6px;
    background: var(--psk-surface, #fff);
    color: var(--psk-text, #1a1a2e);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    width: fit-content;
}
body .fr-auth-wrap .fr-btn--secondary:hover {
    background: var(--psk-bg, #f0f2f8);
    border-color: var(--psk-primary, #4a6cf7);
}

/* ── Checkbox group (interests) ─────────────────────────────── */
body .fr-auth-wrap .fr-checkbox-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
}

body .fr-auth-wrap .fr-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1.5px solid var(--psk-border, #d8dce3);
    border-radius: 7px;
    cursor: pointer;
    font-size: 14px;
    color: var(--psk-text, #1a1a2e);
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}

body .fr-auth-wrap .fr-checkbox-label:hover {
    border-color: var(--psk-primary, #4a6cf7);
    background: var(--psk-bg, #f0f2f8);
}

body .fr-auth-wrap .fr-checkbox-label input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    accent-color: var(--psk-primary, #4a6cf7);
    cursor: pointer;
    flex-shrink: 0;
    margin: 0 !important;
}

body .fr-auth-wrap .fr-checkbox-label:has(input:checked) {
    border-color: var(--psk-primary, #4a6cf7);
    background: color-mix(in srgb, var(--psk-primary, #4a6cf7) 8%, transparent);
}

/* ── Radio group (church reg next step) ─────────────────────── */
body .fr-auth-wrap .fr-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
}

body .fr-auth-wrap .fr-radio-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px solid var(--psk-border, #d8dce3);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}

body .fr-auth-wrap .fr-radio-label:hover {
    border-color: var(--psk-primary, #4a6cf7);
}

body .fr-auth-wrap .fr-radio-label:has(input:checked) {
    border-color: var(--psk-primary, #4a6cf7);
    background: color-mix(in srgb, var(--psk-primary, #4a6cf7) 8%, transparent);
}

body .fr-auth-wrap .fr-radio-label input[type="radio"] {
    width: 16px !important;
    height: 16px !important;
    accent-color: var(--psk-primary, #4a6cf7);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px !important;
}

body .fr-auth-wrap .fr-radio-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

body .fr-auth-wrap .fr-radio-text strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--psk-text, #1a1a2e);
}

body .fr-auth-wrap .fr-radio-text small {
    font-size: 12px;
    color: var(--psk-text-muted, #666e7a);
    line-height: 1.5;
}

/* ── Church reg form header ─────────────────────────────────── */
body .fr-auth-wrap .fr-form-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--psk-border, #e9ecef);
}

body .fr-auth-wrap .fr-form-header__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--psk-text, #1a1a2e);
    margin: 0 0 8px;
}

body .fr-auth-wrap .fr-form-header__desc {
    font-size: 14px;
    color: var(--psk-text-muted, #666e7a);
    margin: 0;
    line-height: 1.65;
}

/* ── Geocode helper embed spacing ───────────────────────────── */
body .fr-auth-wrap .fr-geocode-embed {
    padding: 16px;
    background: var(--psk-bg, #f8f9fa);
    border: 1px solid var(--psk-border, #e9ecef);
    border-radius: 8px;
}

/* ── Church reg wider wrap ──────────────────────────────────── */
body .fr-auth-wrap.fr-church-reg-wrap { max-width: 620px; }

@media (max-width: 480px) {
    body .fr-auth-wrap .fr-checkbox-group { grid-template-columns: 1fr; }
}

/* ── Focus / focus-visible overrides — prevent Elementor pink/magenta bleed ─ */

body .fr-auth-wrap .fr-auth-btn:focus,
body .fr-auth-wrap .fr-auth-btn:focus-visible,
body .fr-auth-wrap button.fr-auth-btn:focus,
body .fr-auth-wrap button.fr-auth-btn:focus-visible,
html body .fr-auth-btn:focus,
html body .fr-auth-btn:focus-visible {
    background-color: var(--psk-primary, #4a6cf7) !important;
    color: #ffffff !important;
    outline: 2px solid var(--psk-primary, #4a6cf7) !important;
    outline-offset: 2px;
}

/* ============================================================
   Unified registration — tabs, panels, invite intro
   ============================================================ */

/* ── Tabs ───────────────────────────────────────────────────── */
/* Brand palette: Blue #2a3e59 (primary/links), Gold #f2d98d (active accent),
   Text #16202f, radius 4px per design system. */
body .fr-register-unified .fr-register-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border: 1.5px solid var(--psk-border, #dde4ec);
    border-radius: 4px;
    overflow: hidden;
    background: var(--psk-bg, #f7f9fb);
}

body .fr-register-unified .fr-register-tab,
html body .fr-register-tab {
    flex: 1;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 13px 16px !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    color: var(--psk-slate, #54728c) !important;
    cursor: pointer !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    outline: none !important;
    transition: background 0.15s, color 0.15s;
}
body .fr-register-unified .fr-register-tab .fr-tab-icon {
    font-size: 14px !important;
    line-height: 1 !important;
}

body .fr-register-unified .fr-register-tab:not(:last-child) {
    border-right: 1.5px solid var(--psk-border, #d8dce3) !important;
}

body .fr-register-unified .fr-register-tab:hover {
    background: var(--psk-surface, #ffffff) !important;
    color: var(--psk-text, #16202f) !important;
}

/* Active tab — Blue text with a Gold underline accent, per design system
   (gold = active nav/tab indicator). */
body .fr-register-unified .fr-register-tab.is-active,
html body .fr-register-tab.is-active {
    background: var(--psk-surface, #ffffff) !important;
    color: var(--psk-primary, #2a3e59) !important;
    box-shadow: inset 0 -3px 0 var(--psk-accent, #f2d98d) !important;
}

body .fr-register-unified .fr-register-tab:focus-visible {
    outline: 2px solid var(--psk-accent, #f2d98d) !important;
    outline-offset: -2px;
}

/* ── Panels ─────────────────────────────────────────────────── */
body .fr-register-unified .fr-register-panel { display: none; }
body .fr-register-unified .fr-register-panel.is-active { display: block; }

body .fr-register-unified .fr-register-panel-intro {
    font-size: 14px;
    color: var(--psk-text-muted, #666e7a);
    margin: 0 0 20px;
    line-height: 1.6;
}

/* ── Invite mode intro ──────────────────────────────────────── */
body .fr-register-unified .fr-register-invite-intro {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--psk-border, #e9ecef);
}

body .fr-register-unified .fr-register-invite-title {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: var(--psk-text, #1a1a2e) !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
}

body .fr-register-unified .fr-register-invite-sub {
    font-size: 14px;
    color: var(--psk-text-muted, #666e7a);
    margin: 0;
    line-height: 1.65;
}

/* ── Locked email field hint ────────────────────────────────── */
body .fr-register-unified .fr-auth-field-hint {
    font-size: 12px;
    color: var(--psk-text-muted, #8b95a2);
    margin-top: 4px;
}

/* Readonly email — visually distinct so it's clear it's locked */
body .fr-register-unified input[readonly].fr-auth-input {
    background: var(--psk-bg, #f0f2f4) !important;
    color: var(--psk-text-muted, #5a6472) !important;
    cursor: not-allowed;
}
