/* =========================================================================
 * ZenAuth-V3.css
 * Shared styles for the Zen 3-aligned Authentication / Error / SSO layouts.
 * Mirrors the token language of ZenMode-V3.css (DM Sans, light surfaces,
 * electric-blue accent) so the unauthenticated screens feel native to Zen 3.
 *
 * Everything is namespaced under body.zen3-auth so it does not bleed into
 * Zen 1 / Zen 2 / Master / authenticated screens.
 * ========================================================================= */

.zen3-auth {
    --z3a-bg: #F7F8FA;
    --z3a-bg-2: #FAFBFC;
    --z3a-surface: #FFFFFF;
    --z3a-surface-hover: #F4F5F7;
    --z3a-border: #ECEEF1;
    --z3a-border-strong: #DDE0E5;
    --z3a-text: #0B0F19;
    --z3a-text-2: #4B5563;
    --z3a-text-3: #8A8F98;
    --z3a-electric: #2E5BFF;
    --z3a-electric-hover: #1D47E8;
    --z3a-electric-soft: rgba(46, 91, 255, 0.10);
    --z3a-electric-glow: rgba(46, 91, 255, 0.18);
    --z3a-radius: 12px;
    --z3a-radius-lg: 18px;
    --z3a-shadow-card: 0 1px 0 rgba(15, 23, 42, 0.04),
                        0 2px 4px rgba(15, 23, 42, 0.05),
                        0 24px 60px rgba(15, 23, 42, 0.10);
    --z3a-shadow-cta:  0 6px 18px rgba(46, 91, 255, 0.28),
                        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    --z3a-shadow-cta-hover: 0 10px 28px rgba(46, 91, 255, 0.36),
                             inset 0 1px 0 rgba(255, 255, 255, 0.28);
    font-family: 'DM Sans', 'Noto Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--z3a-text);
    letter-spacing: -0.005em;
}

/* Body background — subtle premium gradient with very soft electric-blue glow */
body.zen3-auth,
body.zen3-auth[themebg-pattern="pattern2"] {
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(46, 91, 255, 0.10), transparent 60%),
        radial-gradient(720px 420px at -10% 110%, rgba(99, 102, 241, 0.06), transparent 60%),
        linear-gradient(135deg, #FAFBFC 0%, #F4F6FA 50%, #FAFBFC 100%) !important;
    min-height: 100vh;
    color: var(--z3a-text);
}

/* Top-level shell carried over from existing markup (.login.p-fixed.d-flex.text-center).
   Keep the class for compatibility but reset the visual. */
.zen3-auth .login {
    position: relative !important;
    background: transparent !important;
    padding-top: 72px !important;
    padding-bottom: 40px;
    min-height: 100vh;
    color: var(--z3a-text);
}

.zen3-auth .container-fluid { position: relative; z-index: 1; }

.zen3-auth .login-card {
    max-width: 460px;
    margin: 0 auto;
    padding: 0;
}

.zen3-auth .card-block { padding: 0; }

/* ============================================================================
 * Brand row (TK mark + optional co-brand company logo)
 * ========================================================================== */
.zen3-auth .zen3-auth-brand {
    text-align: center;
    margin: 0 0 24px 0;
}

.zen3-auth .zen3-auth-mark {
    display: inline-block;
    object-fit: contain;
    filter: drop-shadow(0 10px 24px rgba(46, 91, 255, 0.20));
}

.zen3-auth .zen3-auth-mark-solo {
    height: 88px;
    width: 88px;
}

.zen3-auth .zen3-auth-cobrand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.70);
    border: 1px solid var(--z3a-border);
    border-radius: 18px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03), 0 10px 28px rgba(15, 23, 42, 0.05);
    backdrop-filter: blur(8px) saturate(140%);
    -webkit-backdrop-filter: blur(8px) saturate(140%);
}

.zen3-auth .zen3-auth-cobrand .zen3-auth-mark {
    height: 60px;
    width: 60px;
    filter: none;
}

.zen3-auth .zen3-auth-cobrand-divider {
    width: 1px;
    height: 48px;
    background: linear-gradient(180deg, transparent 0%, var(--z3a-border-strong) 50%, transparent 100%);
    flex: 0 0 auto;
}

.zen3-auth .zen3-auth-company {
    max-height: 60px;
    max-width: 220px;
    object-fit: contain;
    display: block;
}

/* ============================================================================
 * Glass card
 * ========================================================================== */
.zen3-auth .zen3-auth-panel {
    background: var(--z3a-surface);
    border: 1px solid var(--z3a-border);
    border-radius: var(--z3a-radius-lg);
    padding: 32px;
    box-shadow: var(--z3a-shadow-card);
    text-align: left;
}

/* Inner .auth-box kept transparent — legacy views render their forms inside it. */
.zen3-auth .auth-box {
    max-width: 100%;
    background: transparent !important;
    border: none !important;
    color: var(--z3a-text);
    padding: 0;
    box-shadow: none;
    margin: 0;
}

/* ============================================================================
 * Typography
 * ========================================================================== */
.zen3-auth h1, .zen3-auth h2, .zen3-auth h3, .zen3-auth h4, .zen3-auth h5 {
    color: var(--z3a-text) !important;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.zen3-auth .login-card h3 {
    color: var(--z3a-text) !important;
    font-weight: 600;
    font-size: 22px;
    margin: 0;
}

.zen3-auth .login-card h3 .ph,
.zen3-auth .login-card h3 [class^="ph-"] { margin-right: 6px; opacity: 0.85; }

.zen3-auth .txt-primary { color: var(--z3a-text) !important; }

.zen3-auth hr {
    border: 0;
    border-top: 1px solid var(--z3a-border);
    margin: 18px 0;
}

.zen3-auth p,
.zen3-auth label {
    color: var(--z3a-text-2) !important;
}

.zen3-auth .text-inverse {
    /* Legacy class meant "white on dark"; we're on a light card now. */
    color: var(--z3a-text-2) !important;
}

.zen3-auth .login-card h3.text-inverse,
.zen3-auth h3.text-inverse {
    color: var(--z3a-text) !important;
}

.zen3-auth small,
.zen3-auth .text-muted {
    color: var(--z3a-text-3) !important;
}

/* ============================================================================
 * Form controls
 * ========================================================================== */
.zen3-auth .input-group {
    display: block;
    position: relative;
    margin-bottom: 14px;
    width: 100%;
}

.zen3-auth .form-control,
.zen3-auth input[type="email"],
.zen3-auth input[type="text"],
.zen3-auth input[type="password"],
.zen3-auth input[type="number"],
.zen3-auth input[type="tel"],
.zen3-auth select,
.zen3-auth textarea {
    width: 100%;
    background: var(--z3a-bg-2);
    border: 1px solid var(--z3a-border-strong);
    color: var(--z3a-text);
    border-radius: var(--z3a-radius) !important;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.4;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
    outline: none;
    box-shadow: none;
    height: auto;
}

.zen3-auth .form-control:focus,
.zen3-auth input:focus,
.zen3-auth select:focus,
.zen3-auth textarea:focus {
    background: #FFFFFF;
    border-color: var(--z3a-electric);
    box-shadow: 0 0 0 4px var(--z3a-electric-glow);
    color: var(--z3a-text);
}

.zen3-auth .form-control::placeholder,
.zen3-auth input::placeholder,
.zen3-auth textarea::placeholder { color: var(--z3a-text-3) !important; opacity: 1; }

/* Legacy material-design underline span — hide */
.zen3-auth .md-line { display: none !important; }

/* ============================================================================
 * Buttons
 * ========================================================================== */
.zen3-auth .btn-primary,
.zen3-auth .sign-in-btn {
    width: 100%;
    background: linear-gradient(180deg, #3A66FF 0%, #2548D8 100%);
    background-color: var(--z3a-electric);
    border: 1px solid transparent;
    color: #FFFFFF;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.01em;
    border-radius: var(--z3a-radius);
    box-shadow: var(--z3a-shadow-cta);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
    cursor: pointer;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.zen3-auth .btn-primary:hover,
.zen3-auth .sign-in-btn:hover {
    background: linear-gradient(180deg, #4A74FF 0%, #2E54E8 100%);
    transform: translateY(-1px);
    box-shadow: var(--z3a-shadow-cta-hover);
    color: #FFFFFF;
}

.zen3-auth .btn-primary:active,
.zen3-auth .sign-in-btn:active { transform: translateY(0); }

.zen3-auth .btn-secondary {
    background: var(--z3a-surface);
    border: 1px solid var(--z3a-border-strong);
    color: var(--z3a-text);
    border-radius: var(--z3a-radius);
    padding: 12px 16px;
    font-weight: 500;
}

.zen3-auth .btn-secondary:hover {
    background: var(--z3a-surface-hover);
    color: var(--z3a-text);
}

/* Transparent CTA used on error pages (Contact Us / Dashboard) */
.zen3-auth .transparent-button {
    display: inline-block;
    background: var(--z3a-surface);
    color: var(--z3a-text);
    border: 1px solid var(--z3a-border-strong);
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--z3a-radius);
    text-decoration: none;
    margin: 0 4px 8px 0;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.zen3-auth .transparent-button:hover {
    background: var(--z3a-surface-hover);
    border-color: var(--z3a-text-3);
    color: var(--z3a-text);
    transform: translateY(-1px);
}

/* Show / hide password toggle */
.zen3-auth .view-text {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--z3a-text-3) !important;
    font-size: 12px;
    z-index: 2;
    text-decoration: none;
}

.zen3-auth .view-text:hover { color: var(--z3a-text) !important; }

/* ============================================================================
 * Links
 * ========================================================================== */
.zen3-auth a { color: var(--z3a-electric); }
.zen3-auth a:hover { color: var(--z3a-electric-hover); }

.zen3-auth .login-card a.text-inverse,
.zen3-auth .login-card .text-inverse a {
    color: var(--z3a-text-2) !important;
    text-decoration: none;
    font-weight: 500;
}

.zen3-auth .login-card a.text-inverse:hover,
.zen3-auth .login-card .text-inverse a:hover { color: var(--z3a-electric) !important; }

/* ============================================================================
 * Alerts
 * ========================================================================== */
.zen3-auth .alert {
    background: var(--z3a-surface);
    border: 1px solid var(--z3a-border-strong);
    color: var(--z3a-text);
    border-radius: var(--z3a-radius);
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 13.5px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.zen3-auth .alert-danger  { background: #FEF2F2; border-color: #FCA5A5; color: #991B1B; }
.zen3-auth .alert-success { background: #ECFDF5; border-color: #6EE7B7; color: #065F46; }
.zen3-auth .alert-warning { background: #FFFBEB; border-color: #FCD34D; color: #92400E; }
.zen3-auth .alert-info    { background: #EEF2FF; border-color: #A5B4FC; color: #1E3A8A; }

/* Validation summary (MVC) */
.zen3-auth .validation-summary-errors,
.zen3-auth .field-validation-error {
    color: #B91C1C !important;
    font-size: 13px;
    margin: -4px 0 10px 0;
}

.zen3-auth .validation-summary-errors ul { margin: 0; padding-left: 18px; }

/* ============================================================================
 * Legacy checkbox (.checkbox-fade + .cr) used by SignIn "Remember Me"
 * ========================================================================== */

.zen3-auth .form-check {
    display: flex;
    align-items: center;
    gap: 0.25rem;

    label {
        margin: 0;
    }

    input[type="checkbox"] {
        accent-color: var(--z3a-electric);
        width: 16px;
        height: 16px;
        margin: 0;
    }
}

/* ============================================================================
 * Language toggle
 * ========================================================================== */
.zen3-auth .change-language {
    background: var(--z3a-surface) !important;
    border: 1px solid var(--z3a-border) !important;
    color: var(--z3a-text);
    border-radius: var(--z3a-radius) !important;
    margin: 14px 0;
    padding: 10px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

/* ============================================================================
 * Footer
 * ========================================================================== */
.zen3-auth .zen3-auth-footer {
    margin-top: 22px;
    text-align: center;
    color: var(--z3a-text-3);
    font-size: 11.5px;
    line-height: 1.7;
}

.zen3-auth .zen3-auth-footer a {
    color: var(--z3a-text-2);
    text-decoration: none;
    border-bottom: 1px dotted var(--z3a-border-strong);
}

.zen3-auth .zen3-auth-footer a:hover {
    color: var(--z3a-electric);
    border-bottom-color: var(--z3a-electric);
}

.zen3-auth .zen3-auth-footer .footer-row { margin-top: 2px; }

.zen3-auth .zen3-auth-footer .powered-by {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    padding: 5px 12px 5px 8px;
    background: var(--z3a-surface);
    border: 1px solid var(--z3a-border);
    border-radius: 999px;
    font-size: 10.5px;
    color: var(--z3a-text-2);
    letter-spacing: 0.02em;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.zen3-auth .zen3-auth-footer .powered-by img {
    height: 16px;
    width: 16px;
    object-fit: contain;
}

.zen3-auth .zen3-auth-footer .test-env {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    background: #FEF2F2;
    border: 1px solid #FCA5A5;
    color: #991B1B;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
}

/* ============================================================================
 * Modal — keep light so it matches the page
 * ========================================================================== */
.zen3-auth #ajax-modal .modal-content {
    background: #FFFFFF;
    color: var(--z3a-text);
    border-radius: 14px;
    border: none;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.18);
}

/* ============================================================================
 * Responsive
 * ========================================================================== */
@media (max-width: 540px) {
    .zen3-auth .login { padding-top: 32px !important; }
    .zen3-auth .login-card { padding: 0 16px; }
    .zen3-auth .zen3-auth-panel { padding: 24px 20px; border-radius: 14px; }
    .zen3-auth .zen3-auth-mark-solo { height: 72px; width: 72px; }
    .zen3-auth .zen3-auth-cobrand { gap: 14px; padding: 10px 14px; }
    .zen3-auth .zen3-auth-cobrand .zen3-auth-mark { height: 48px; width: 48px; }
    .zen3-auth .zen3-auth-cobrand-divider { height: 40px; }
    .zen3-auth .zen3-auth-company { max-height: 48px; max-width: 170px; }
}

/* ============================================================================
 * Native-only / non-native visibility
 * Matches the legacy auth-layout convention: .native = visible only in the
 * GoNative mobile shell, .non-native = visible only in a web browser.
 * ========================================================================== */
.zen3-auth .native { display: none !important; }

/* ============================================================================
 * Customer Portal theme
 * The customer-facing auth screens (the CustomerPortal area) carry the
 * JobCloser brand: the CTA + accent use the deep royal blue from the JobCloser
 * logo so buyers know they're on THEIR portal rather than the staff sign-in.
 * Everything is driven off the --z3a-electric* variables below; only the
 * hardcoded CTA gradient stops and the body glow need their own overrides.
 * ========================================================================== */
body.zen3-auth.zen3-auth-portal {
    --z3a-electric: #0A6FE0;
    --z3a-electric-hover: #0A5FC8;
    --z3a-electric-soft: rgba(10, 111, 224, 0.10);
    --z3a-electric-glow: rgba(10, 111, 224, 0.18);
    --z3a-shadow-cta: 0 6px 18px rgba(10, 111, 224, 0.28),
                       inset 0 1px 0 rgba(255, 255, 255, 0.22);
    --z3a-shadow-cta-hover: 0 10px 28px rgba(10, 111, 224, 0.36),
                             inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

body.zen3-auth.zen3-auth-portal,
body.zen3-auth.zen3-auth-portal[themebg-pattern="pattern2"] {
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(10, 111, 224, 0.10), transparent 60%),
        radial-gradient(720px 420px at -10% 110%, rgba(46, 91, 255, 0.05), transparent 60%),
        linear-gradient(135deg, #FBFCFE 0%, #F3F6FB 50%, #FBFCFE 100%) !important;
}

/* Sign-in CTA wears the Orbit AI look — the blue→green "icon-orbitai" gradient
   (--color-blue-500 → --color-green-600, inlined as hex since the auth page
   doesn't load those tokens) — with a soft sheen that sweeps across every few
   seconds, the same shimmer technique as the Zen 3 edit-ribbon CTA. */
.zen3-auth-portal .btn-primary,
.zen3-auth-portal .sign-in-btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border: none;
    background: linear-gradient(120deg, #3B82F6 0%, #2A8FC9 45%, #16A34A 100%);
    background-color: #2A8FC9;
}

.zen3-auth-portal .btn-primary:hover,
.zen3-auth-portal .sign-in-btn:hover {
    background: linear-gradient(120deg, #4C8DF7 0%, #2F9AD6 45%, #1AAE50 100%);
}

.zen3-auth-portal .btn-primary::after,
.zen3-auth-portal .sign-in-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        100deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.40) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-20deg);
    animation: jc-signin-shimmer 3.4s ease-in-out infinite;
    pointer-events: none;
}

.zen3-auth-portal .btn-primary:hover::after,
.zen3-auth-portal .sign-in-btn:hover::after { animation: none; }

@keyframes jc-signin-shimmer {
    0% { left: -75%; }
    60% { left: 130%; }
    100% { left: 130%; }
}

@media (prefers-reduced-motion: reduce) {
    .zen3-auth-portal .btn-primary::after,
    .zen3-auth-portal .sign-in-btn::after { animation: none; }
}

.zen3-auth.zen3-auth-portal .zen3-auth-mark {
    filter: drop-shadow(0 10px 24px rgba(10, 111, 224, 0.22));
}

/* JobCloser product wordmark on portal sign-in screens (see _Zen3AuthBrand.cshtml) */
.zen3-auth.zen3-auth-portal .zen3-auth-wordmark {
    display: inline-block;
    width: 230px;
    max-width: 72vw;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 24px rgba(15, 23, 42, 0.10));
}
