/**
 * PaystubX auth modals (.axm-*) — login, OTP, signup, logout.
 *
 * Loaded on every app-layout page (including /dashboard) because
 * partials/auth-modals.blade.php is always included. Dashboard must not
 * pull the full responsive-form.css marketing/form sheet just to style
 * Sign out.
 *
 * This file is the source of truth. Do not duplicate these rules in
 * responsive-form.css or responsive-fix.css.
 */
.axm-dialog { max-width: 420px; width: 100%; margin: 1rem auto; }
.axm-dialog--sm { max-width: 360px; }
.axm-card {
    border: none;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,.18);
    font-family: 'Inter','Segoe UI',-apple-system,BlinkMacSystemFont,sans-serif;
}
.axm-header {
    /* White header — blue PaystubX logo needs non-blue contrast */
    background: #ffffff;
    border-bottom: 1px solid #e6ebf3;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.axm-logo { height: 34px; width: auto; object-fit: contain; }
.axm-header__text { font-size: 15px; font-weight: 700; color: #0f1b3d; letter-spacing: .2px; }
.axm-close {
    background: #f1f4f9;
    border: none;
    color: #0f1b3d;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    padding: 0;
    flex-shrink: 0;
}
.axm-close:hover { background: #e4e9f2; color: #0a1228; }
.axm-body { padding: 32px 28px 28px; background: #fff; }
.axm-body--otp { text-align: center; }
.axm-body--center { text-align: center; }
.axm-title { font-size: 1.35rem; font-weight: 800; color: #0f1b3d; margin: 0 0 6px; line-height: 1.25; }
.axm-subtitle { font-size: 13.5px; color: #666; margin: 0 0 24px; line-height: 1.6; }
.axm-note { font-size: 11.5px; color: #999; display: block; margin-top: 3px; }
.axm-google-wrap {
    display: block;
    width: 100%;
    min-height: 40px;
    height: 40px;
    margin-bottom: 20px;
    overflow: hidden;
}
.axm-google-wrap .g_id_signin {
    display: block;
    width: 100%;
    min-height: 40px;
    height: 40px;
}
/* Bootstrap fade uses transform on .modal-dialog. Google's GSI iframe inside a
   transforming ancestor jitters/shakes (and FedCM positioning breaks). Fade with opacity only. */
#loginModal.fade .modal-dialog,
#loginPasswordModal.fade .modal-dialog,
#otpModal.fade .modal-dialog,
#forgotPasswordModal.fade .modal-dialog,
#signupModal.fade .modal-dialog,
#setName.fade .modal-dialog,
#logoutModal.fade .modal-dialog {
    transform: none !important;
    -webkit-transform: none !important;
    transition: none;
}

/* Sign in with Apple — iOS webapp only (hidden on website) */
.psx-apple-only { display: none !important; }
html.psx-ios-webapp .psx-apple-only,
body.psx-auth-webapp .psx-apple-only { display: block !important; }
.axm-apple-wrap { margin-bottom: 12px; }
.axm-btn--apple {
    display: block;
    position: relative;
    width: 100%;
    height: 40px;
    min-height: 40px;
    padding: 0 50px;
    border: none;
    border-radius: 4px !important;
    background: #000000;
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    box-sizing: border-box;
    overflow: hidden;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
.axm-btn--apple:active { opacity: 0.88; }
.axm-apple-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    overflow: visible;
}
.axm-apple-text {
    position: absolute;
    left: 50px;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    display: block;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}
html.psx-ios-webapp .axm-google-wrap,
body.psx-auth-webapp .axm-google-wrap { margin-bottom: 20px; margin-top: 0; }
html.psx-ios-webapp .axm-auth-social,
body.psx-auth-webapp .axm-auth-social {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}
html.psx-ios-webapp .axm-apple-wrap,
body.psx-auth-webapp .axm-apple-wrap {
    margin-bottom: 0 !important;
}
html.psx-ios-webapp .axm-google-wrap,
body.psx-auth-webapp .axm-google-wrap {
    display: block;
    width: 100%;
    min-height: 40px;
    margin-bottom: 0 !important;
}
html.psx-ios-webapp .g_id_signin,
body.psx-auth-webapp .g_id_signin {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 40px;
    margin: 0;
}
/* Region login modal — match standalone slide-menu button layout exactly */
html.psx-ios-webapp body:not(.psx-auth-standalone) #loginModal .modal-dialog {
    max-width: 420px !important;
    width: calc(100% - 32px) !important;
    margin: 1rem auto !important;
}
html.psx-ios-webapp body:not(.psx-auth-standalone) #loginModal .axm-body {
    padding: 28px 20px 24px !important;
}
html.psx-ios-webapp body:not(.psx-auth-standalone) #loginModal .axm-apple-wrap,
html.psx-ios-webapp body:not(.psx-auth-standalone) #loginModal .axm-google-wrap {
    width: 100%;
    margin: 0 !important;
    display: block;
}
html.psx-ios-webapp body:not(.psx-auth-standalone) #loginModal .axm-btn--apple {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    height: 40px;
    min-height: 40px;
}
html.psx-ios-webapp body:not(.psx-auth-standalone) #loginModal .g_id_signin {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 40px;
}

.axm-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 0 0 22px; color: #bbb; font-size: 12px; font-weight: 500;
}
.axm-divider::before, .axm-divider::after {
    content: ''; flex: 1; height: 1px; background: #e8eaf0;
}
.axm-field { margin-bottom: 16px; position: relative; }
.axm-label { display: block; font-size: 12.5px; font-weight: 600; color: #374151; margin-bottom: 6px; letter-spacing: .2px; }
.axm-required { color: #d32f0c; }
.axm-input {
    width: 100%;
    border: 1.5px solid #dde1ec;
    border-radius: 10px;
    padding: 11px 14px !important;
    font-size: 14px;
    color: #111;
    background: #fafbfd;
    transition: border-color .18s, box-shadow .18s;
    height: auto !important;
    line-height: 1.5 !important;
    outline: none;
}
.axm-input:focus {
    border-color: #1a2e6e;
    box-shadow: 0 0 0 3px rgba(26,46,110,.1);
    background: #fff;
}
.axm-input--otp {
    text-align: center; font-size: 1.6rem !important;
    font-weight: 700; letter-spacing: 6px; padding: 14px !important;
}
.axm-input-wrap { position: relative; }
/* ADP / Gusto-style password reveal: quiet glyph button inside the field. */
.axm-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    line-height: 0;
    pointer-events: auto;
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s ease, background-color .15s ease;
}
.axm-eye:hover {
    color: #374151;
    background: rgba(15, 27, 61, 0.05);
}
.axm-eye:focus {
    outline: none;
}
.axm-eye:focus-visible {
    color: #1a2e6e;
    background: rgba(26, 46, 110, 0.08);
    box-shadow: 0 0 0 2px rgba(26, 46, 110, 0.22);
}
.axm-eye[aria-pressed="true"] {
    color: #1a2e6e;
}
.axm-eye__icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
    display: block;
    flex-shrink: 0;
}
.axm-eye__icon--hide { display: none; }
.axm-eye[aria-pressed="true"] .axm-eye__icon--show { display: none; }
.axm-eye[aria-pressed="true"] .axm-eye__icon--hide { display: block; }
/*
 * contact-box uses width:93% in newstyle.css — eye is positioned on the full wrap,
 * so it sits on the border. Fill the wrap and pad for the icon.
 */
.axm-input-wrap input.axm-input.contact-box {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box !important;
    padding-right: 44px !important;
}
.axm-btn {
    display: block; width: 100%; padding: 13px 16px;
    border-radius: 10px; font-size: 14px; font-weight: 700;
    border: none; cursor: pointer;
    transition: background .16s, transform .1s, box-shadow .16s;
    text-align: center; text-decoration: none; line-height: 1.4; margin-top: 4px;
    box-sizing: border-box;
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
.axm-btn:active { transform: scale(.97); }
.axm-btn--primary {
    background: linear-gradient(135deg, #1a2e6e, #2d1b69);
    color: #fff; box-shadow: 0 4px 14px rgba(26,46,110,.3); margin-bottom: 0;
}
.axm-btn--primary:hover {
    background: linear-gradient(135deg, #0f1b3d, #1a0e40);
    box-shadow: 0 6px 20px rgba(26,46,110,.4); color: #fff; text-decoration: none;
}
.axm-btn--danger { background: #d32f0c; color: #fff; box-shadow: 0 4px 14px rgba(211,47,12,.25); }
.axm-btn--danger:hover { background: #b02509; color: #fff; text-decoration: none; }
.axm-btn--ghost { background: #f3f4f8; color: #374151; border: 1.5px solid #dde1ec; box-shadow: none; }
.axm-btn--ghost:hover { background: #e8eaf0; color: #111; text-decoration: none; }
.axm-forgot-row { text-align: right; margin: -6px 0 16px; }
.axm-link { color: #1a2e6e; font-size: 13px; font-weight: 600; text-decoration: none; }
.axm-link:hover { color: #d32f0c; text-decoration: underline; }

/*
 * Resend code + clock — one glossy red only.
 * Never put opacity on <a> alone during countdown: it fades “Resend code” but not the <i> clock → mismatch.
 */
#otpModal .axm-resend-row.resend-otp {
    --psx-resend-gloss: #c40012;
}
#otpModal p.axm-resend-row a#resendOtpButton.axm-link,
#otpModal a#resendOtpButton.axm-link,
a#resendOtpButton.axm-link,
a#resendOtpButton {
    color: var(--psx-resend-gloss, #c40012) !important;
    -webkit-text-fill-color: var(--psx-resend-gloss, #c40012) !important;
    background: none !important;
    background-clip: unset !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    opacity: 1 !important;
    transition: filter 0.15s, color 0.15s;
    display: inline-block;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.92),
        0 -1px 0 rgba(85, 0, 0, 0.48),
        0 2px 12px rgba(196, 0, 18, 0.42);
}
#otpModal p.axm-resend-row a#resendOtpButton.axm-link:hover,
#otpModal a#resendOtpButton.axm-link:hover,
a#resendOtpButton.axm-link:hover,
a#resendOtpButton:hover {
    color: #9c0010 !important;
    -webkit-text-fill-color: #9c0010 !important;
    filter: brightness(1.05);
    text-decoration: underline !important;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.98),
        0 0 16px rgba(196, 0, 18, 0.55);
}
/* Same visual weight as link (no faded text vs bold icon) — still non-clickable via pointer-events */
#otpModal p.axm-resend-row a#resendOtpButton.pointer-disable,
a#resendOtpButton.pointer-disable {
    opacity: 1 !important;
    cursor: not-allowed !important;
}
#otpModal .axm-resend-row .fa-clock-o.clock {
    color: var(--psx-resend-gloss, #c40012) !important;
    -webkit-text-fill-color: var(--psx-resend-gloss, #c40012) !important;
    opacity: 1 !important;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.92),
        0 -1px 0 rgba(85, 0, 0, 0.48),
        0 2px 12px rgba(196, 0, 18, 0.42);
}
/* Same gloss where resend row is not inside #otpModal (e.g. profile verify UI) */
p.resend-otp .fa-clock-o.clock {
    color: #c40012 !important;
    -webkit-text-fill-color: #c40012 !important;
    opacity: 1 !important;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.92),
        0 -1px 0 rgba(85, 0, 0, 0.48),
        0 2px 12px rgba(196, 0, 18, 0.42);
}
.axm-back-row { text-align: center; margin: 16px 0 0; }
.axm-terms { font-size: 11px; color: #aaa; text-align: center; margin: 16px 0 0; line-height: 1.6; }
.axm-terms a { color: #1a2e6e; text-decoration: none; }
.axm-terms a:hover { text-decoration: underline; }
.axm-otp-icon { font-size: 3rem; margin-bottom: 16px; display: block; line-height: 1; }
.axm-resend-row { text-align: center; font-size: 13px; color: #888; margin: 16px 0 0; }
/* OTP modal: newstyle.css p.resend-otp uses margin-top:-10px — overlaps Verify button */
#otpModal .axm-resend-row.resend-otp {
    display: block;
    text-align: center;
    margin-top: 1.35rem;
    margin-right: 0;
    margin-bottom: 0;
}
.axm-logout-icon { font-size: 2.5rem; margin-bottom: 12px; display: block; }
.axm-logout-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
/* Firefox paints type=submit with native chrome unless appearance is none.
   newstyle.css .bottom-close (preview close) must not restyle these buttons. */
#logoutModal .axm-logout-btns .axm-btn,
#logoutModal .axm-logout-btns .bottom-close {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px !important;
    font-weight: 700;
    line-height: 1.4;
    padding: 13px 16px !important;
    margin: 0 !important;
    border-radius: 10px !important;
    border: none !important;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
#logoutModal .axm-btn--danger,
#logoutModal button.axm-btn[type="submit"] {
    background: #d32f0c !important;
    background-image: none !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(211,47,12,.25) !important;
}
#logoutModal .axm-btn--danger:hover,
#logoutModal button.axm-btn[type="submit"]:hover {
    background: #b02509 !important;
    color: #fff !important;
    text-decoration: none;
}
/* Cancel: same development palette — secondary red, not gray ghost / not native */
#logoutModal .axm-btn--ghost {
    background: #e84040 !important;
    background-image: linear-gradient(135deg, #e84040 0%, #c62828 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(211,47,12,.20) !important;
}
#logoutModal .axm-btn--ghost:hover {
    background: #c62828 !important;
    background-image: linear-gradient(135deg, #c62828 0%, #a40011 100%) !important;
    color: #ffffff !important;
}
.axm-form-footer { display: flex; gap: 10px; margin-top: 20px; }
.axm-form-footer .axm-btn { margin: 0; }
@media (max-width: 480px) {
    .axm-dialog { max-width: 96vw; margin: .5rem auto; }
    .axm-body { padding: 24px 18px 20px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   SIGNUP MODAL — two-step inline UX  (Jun 2026)
   ═══════════════════════════════════════════════════════════════════════ */

/* Honeypot field — must be completely invisible */
.axm-hp-field {
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
}

/* Inline field-level error message */
.axm-field-error {
    display: none;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 7px 10px;
    background: #fff5f5;
    border: 1px solid #fca5a5;
    border-radius: 7px;
    font-size: 12.5px;
    color: #b91c1c;
    line-height: 1.4;
}
.axm-field-error::before {
    content: "\26A0\0020";
    font-size: 13px;
    flex-shrink: 0;
}
.axm-field-error.is-visible {
    display: flex;
}

/* Input in error state */
.axm-input.axm-input--error {
    border-color: #fca5a5 !important;
    background: #fff5f5 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

/* Locked email row shown in step 2 */
.axm-email-locked {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 10px 14px;
    background: #f3f6ff;
    border: 1px solid #d0d9f5;
    border-radius: 10px;
    font-size: 13.5px;
    color: #1a2e6e;
    font-weight: 500;
    overflow: hidden;
}
.axm-email-locked__icon {
    font-size: 15px;
    flex-shrink: 0;
    color: #4b6ef5;
}
.axm-email-locked__addr {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #0f1b3d;
    font-weight: 600;
}
.axm-email-locked__change {
    flex-shrink: 0;
    font-size: 12px;
    color: #4b6ef5;
    text-decoration: none;
    font-weight: 500;
}
.axm-email-locked__change:hover {
    text-decoration: underline;
    color: #1a2e6e;
}

/* ── Responsive: small phones ────────────────────────────────────── */
@media (max-width: 400px) {
    /* Give the body a bit more breathing room */
    #signupModal .axm-body {
        padding: 22px 14px 20px;
    }
    /* Turnstile widget: scale down to fit without overflow */
    #signupModal .cf-turnstile {
        transform: scale(0.88);
        transform-origin: 0 0;
    }
    /* Stack Cancel + Create Account vertically on very small screens */
    #signupModal .axm-form-footer {
        flex-direction: column;
        gap: 8px;
    }
    #signupModal .axm-form-footer .axm-btn {
        width: 100%;
        text-align: center;
    }
    /* Email locked badge: allow email to wrap instead of getting clipped */
    .axm-email-locked__addr {
        white-space: normal;
        word-break: break-all;
    }
}

/* ── Landscape phones: limit modal height and scroll ─────────────── */
@media (max-height: 600px) and (max-width: 900px) {
    #signupModal .modal-dialog {
        align-items: flex-start;
        margin-top: 10px;
    }
    #signupModal .axm-body {
        max-height: 85vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}
