/* ==========================================================================
   Marketing-matched auth theme
   Layered on top of auth.css and scoped to <body class="auth-mk">, so the
   login and worker-claim pages that share auth.css keep their current look.
   Palette and shapes mirror assets/css/marketing.css (the splash + /product
   pages): slate board background, dot grid, indigo→purple gradient actions.
   ========================================================================== */

body.auth-mk {
    background: #0f172a;
    color: #f8fafc;
}

/* Board surface: slate gradient + the canvas grid dots, as on the marketing
   closing band. .auth-background/.auth-particles are existing empty hooks. */
body.auth-mk .auth-background {
    background:
        radial-gradient(1100px 760px at 12% 8%, rgba(76, 99, 210, 0.50) 0%, transparent 62%),
        radial-gradient(900px 700px at 92% 88%, rgba(118, 75, 162, 0.42) 0%, transparent 60%),
        linear-gradient(135deg, #0f172a 0%, #1e293b 58%, #241d43 100%);
}

body.auth-mk .auth-particles {
    background-image: radial-gradient(rgba(248, 250, 252, 0.15) 1.4px, transparent 1.5px);
    background-size: 26px 26px;
    mask-image: radial-gradient(120% 100% at 50% 30%, #000 30%, transparent 76%);
    -webkit-mask-image: radial-gradient(120% 100% at 50% 30%, #000 30%, transparent 76%);
}

/* --------------------------------------------------------------------------
   Card
   -------------------------------------------------------------------------- */

body.auth-mk .auth-card {
    background: rgba(15, 23, 42, 0.66);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(248, 250, 252, 0.14);
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.45);
    max-width: 520px;
}

/* The wordmark is white here; the dot keeps its brand yellow (set on the SVG). */
body.auth-mk .auth-logo a {
    display: inline-block;
    line-height: 0;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
}

body.auth-mk .auth-subtitle {
    color: rgba(248, 250, 252, 0.72);
}

/* --------------------------------------------------------------------------
   Fields
   -------------------------------------------------------------------------- */

body.auth-mk .form-group label {
    color: rgba(248, 250, 252, 0.92);
    font-weight: 600;
}

body.auth-mk .auth-form .input-group input {
    background: rgba(248, 250, 252, 0.06);
    border: 1.5px solid rgba(248, 250, 252, 0.18);
    border-radius: 12px;
    color: #f8fafc;
}

body.auth-mk .auth-form .input-group input::placeholder {
    color: rgba(248, 250, 252, 0.42);
}

body.auth-mk .auth-form .input-group input:focus {
    background: rgba(248, 250, 252, 0.10);
    border-color: #8b9eff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

/* Neutral resting border regardless of :valid/:invalid, matching auth.css intent */
body.auth-mk .auth-form .input-group input:valid:not(:placeholder-shown):not(:focus):not(.error),
body.auth-mk .auth-form .input-group input:invalid:not(:placeholder-shown):not(:focus):not(.error) {
    border-color: rgba(248, 250, 252, 0.18);
}

/* Chrome paints autofilled fields near-white without this. */
body.auth-mk .auth-form .input-group input:-webkit-autofill,
body.auth-mk .auth-form .input-group input:-webkit-autofill:hover,
body.auth-mk .auth-form .input-group input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #1c2740 inset;
    -webkit-text-fill-color: #f8fafc;
    caret-color: #f8fafc;
}

body.auth-mk .input-group > i { color: rgba(248, 250, 252, 0.45); }
body.auth-mk .input-group input:focus + i { color: #8b9eff; }
body.auth-mk .input-group .password-toggle { color: rgba(248, 250, 252, 0.5); }
body.auth-mk .password-toggle:hover { color: #8b9eff; }

body.auth-mk .help-text { color: rgba(248, 250, 252, 0.55); }
body.auth-mk .strength-text { color: rgba(248, 250, 252, 0.6); }
body.auth-mk .strength-bar { background: rgba(248, 250, 252, 0.12); }

/* #ef4444 clears 3:1 on this surface but reads muddy; lift it for body text. */
body.auth-mk .error-message { color: #fca5a5; }

/* --------------------------------------------------------------------------
   Checkboxes
   -------------------------------------------------------------------------- */

/* Register stacks two full-sentence consent lines; login keeps its
   "Remember me" / "Forgot password?" row side by side (auth.css default). */
body.auth-mk .form-options--stack {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.6rem;
}

body.auth-mk .forgot-link { color: #9ca8f7; }
body.auth-mk .forgot-link:hover { color: #b9c2fb; }

/* auth.css makes the label a flex row, which turns every text node and link
   into its own flex item — the consent line then wraps into ragged columns on
   narrow screens. Inline flow with a hanging indent keeps it reading as a
   sentence, with wrapped lines clearing the box. */
body.auth-mk .checkbox-label {
    display: block;
    color: rgba(248, 250, 252, 0.85);
    line-height: 1.45;
    padding-left: 28px;
    text-indent: -28px;
}

/* auth.css hides the real input (display:none) and paints .checkmark in its
   place, which drops the box out of the tab order — keyboard users could not
   tick the required "I agree to the Terms" box. Style the input itself instead
   so it stays focusable, and retire the decorative span on this page. */
body.auth-mk .checkbox-label .checkmark { display: none; }

body.auth-mk .checkbox-label input[type="checkbox"] {
    display: inline-grid;      /* inline so it flows with the sentence */
    place-items: center;
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin: 0 10px 0 0;
    vertical-align: -3px;
    text-indent: 0;
    flex: 0 0 auto;
    border: 2px solid rgba(248, 250, 252, 0.35);
    border-radius: 4px;
    background: rgba(248, 250, 252, 0.06);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

body.auth-mk .checkbox-label input[type="checkbox"]:checked {
    background: #667eea;
    border-color: #667eea;
}

body.auth-mk .checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    color: #fff;
    font-size: 0.72rem;
    font-weight: bold;
    line-height: 1;
}

body.auth-mk .checkbox-label input[type="checkbox"]:focus-visible {
    outline: 3px solid #8b9eff;
    outline-offset: 2px;
}

body.auth-mk .checkbox-label a,
body.auth-mk .checkbox-label a:visited { color: #9ca8f7; }
body.auth-mk .checkbox-label a:hover { color: #b9c2fb; }

/* --------------------------------------------------------------------------
   Actions — the marketing gradient pill
   -------------------------------------------------------------------------- */

body.auth-mk .auth-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 999px;
    height: 52px;
    font-weight: 640;
    letter-spacing: 0.005em;
    box-shadow: 0 10px 26px rgba(102, 126, 234, 0.34);
    margin-top: 0.5rem;
}

body.auth-mk .auth-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #5568d3 0%, #6a4494 100%);
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(102, 126, 234, 0.42);
}

body.auth-mk .auth-button:disabled,
body.auth-mk .auth-button[aria-disabled="true"] {
    background: rgba(248, 250, 252, 0.16);
    box-shadow: none;
    transform: none;
    opacity: 0.8;
}

body.auth-mk .social-button {
    background: rgba(248, 250, 252, 0.07);
    border: 1.5px solid rgba(248, 250, 252, 0.20);
    border-radius: 999px;
    color: #f8fafc;
}

body.auth-mk .social-button:hover { border-color: #8b9eff; background: rgba(248, 250, 252, 0.12); }
body.auth-mk .social-button.google:hover { border-color: #ea4335; color: #ffb4ab; }
body.auth-mk .social-button.github:hover { border-color: rgba(248, 250, 252, 0.7); color: #fff; }

/* --------------------------------------------------------------------------
   Divider — two rules flanking the label, so no opaque chip is needed over a
   translucent card (auth.css sits a solid-background span on one long rule).
   -------------------------------------------------------------------------- */

body.auth-mk .auth-divider::before {
    right: calc(50% + 30px);
    background: rgba(248, 250, 252, 0.16);
}

body.auth-mk .auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    left: calc(50% + 30px);
    right: 0;
    height: 1px;
    background: rgba(248, 250, 252, 0.16);
}

body.auth-mk .auth-divider span {
    background: transparent;
    color: rgba(248, 250, 252, 0.55);
}

/* --------------------------------------------------------------------------
   Footer + modals
   -------------------------------------------------------------------------- */

body.auth-mk .auth-footer { border-top-color: rgba(248, 250, 252, 0.14); }
body.auth-mk .auth-footer p { color: rgba(248, 250, 252, 0.7); }
body.auth-mk .auth-footer a { color: #9ca8f7; }
body.auth-mk .auth-footer a:hover { color: #b9c2fb; }

body.auth-mk .modal-content {
    background: #101a2e;
    border: 1px solid rgba(248, 250, 252, 0.14);
    border-radius: 20px;
}
body.auth-mk .modal-header { border-bottom-color: rgba(248, 250, 252, 0.14); }
body.auth-mk .modal-header h3 { color: #f8fafc; }
body.auth-mk .modal-close { color: rgba(248, 250, 252, 0.6); }
body.auth-mk .modal-close:hover { background: rgba(248, 250, 252, 0.08); color: #fff; }
body.auth-mk .modal-body p { color: rgba(248, 250, 252, 0.78); }
body.auth-mk .success-icon { color: #10b981; }

body.auth-mk .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 999px;
    padding: 0.75rem 1.75rem;
}
body.auth-mk .btn-primary:hover { background: linear-gradient(135deg, #5568d3 0%, #6a4494 100%); }

/* Visible keyboard focus on the dark surface */
body.auth-mk :focus-visible {
    outline: 3px solid #8b9eff;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    body.auth-mk .auth-card,
    body.auth-mk .form-group { animation: none; }
    body.auth-mk .auth-button:hover:not(:disabled) { transform: none; }
}
