/* ═══════════════════════════════════════════════════════════════════════════
 * KingdomEdge Algo — WordPress Login Page Rebrand
 * Path: /wp-content/themes/kingdomedge/login-styles.css
 * Enqueued via `login_enqueue_scripts` in functions.php
 *
 * Shipped 2026-07-11 for Task #147 (John's audit finding from 2026-06-27):
 * default WP branding on /wp-login.php broke the end-to-end KE experience.
 * Felix arrives 2026-07-14 — this must land before then.
 *
 * All selectors are scoped under `body.login` to prevent leaks into wp-admin.
 * Brand palette: Navy #0a1f44 · Navy-deep #061229 · Green #7AB648 ·
 * Green-deep #5A8635 · Gold #D4AF37 · Paper #F7F5EE · Text-on-navy #E8ECF3.
 * ═══════════════════════════════════════════════════════════════════════════ */


/* ─── 1. FULL-PAGE BACKGROUND ─────────────────────────────────────────────── */

body.login {
    /* Deep navy gradient — matches homepage hero + operator dashboard */
    background: linear-gradient(135deg, #0a1f44 0%, #061229 100%) !important;
    background-attachment: fixed;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #E8ECF3;
    margin: 0;
    padding: 0;
    position: relative;
    overflow-x: hidden;
}

/* Subtle radial glow behind the login card to draw the eye */
body.login::before {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 900px;
    height: 900px;
    background: radial-gradient(circle,
        rgba(122, 182, 72, 0.08) 0%,
        rgba(122, 182, 72, 0.03) 40%,
        transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Faint scripture/attribution corner watermark — quiet, never dominant */
body.login::after {
    content: "Deuteronomy 8:18";
    position: fixed;
    bottom: 18px;
    right: 24px;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(212, 175, 55, 0.45);
    pointer-events: none;
    z-index: 1;
    font-weight: 500;
}


/* ─── 2. LOGIN WRAPPER ────────────────────────────────────────────────────── */

body.login #login {
    padding-top: 6vh;
    padding-bottom: 40px;
    width: 380px;
    max-width: 92vw;
    position: relative;
    z-index: 2;
}


/* ─── 3. LOGO — replace default WP "W" with KE branded lockup ─────────────── */

body.login h1 a {
    /* Inline SVG data-URI: green triangle + KingdomEdge Algo wordmark.
     * Triangle uses the exact polygon pattern from header.php (0,10 14,10 7,-4)
     * scaled up. Text uses a heavier navy-appropriate weight. */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 100'><g transform='translate(30,26)'><polygon points='0,44 42,44 21,2' fill='%237AB648'/><polygon points='6,38 36,38 21,10' fill='%235A8635' opacity='0.55'/></g><text x='95' y='52' font-family='-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif' font-weight='700' font-size='26' fill='%23F7F5EE' letter-spacing='0.5'>Kingdom<tspan fill='%237AB648'>Edge</tspan></text><text x='95' y='78' font-family='-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif' font-weight='500' font-size='13' fill='%23D4AF37' letter-spacing='4.5'>A L G O</text></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: contain !important;
    background-color: transparent !important;
    width: 320px !important;
    height: 100px !important;
    text-indent: -9999px;
    overflow: hidden;
    display: block;
    margin: 0 auto 24px !important;
    padding: 0 !important;
    outline: none;
    box-shadow: none;
    transition: transform 0.25s ease, filter 0.25s ease;
}

body.login h1 a:hover,
body.login h1 a:focus {
    transform: scale(1.02);
    filter: drop-shadow(0 0 12px rgba(122, 182, 72, 0.35));
    outline: none;
    box-shadow: none;
}


/* ─── 4. LOGIN FORM CARD ──────────────────────────────────────────────────── */

body.login #loginform,
body.login #registerform,
body.login #lostpasswordform,
body.login #resetpassform {
    background: #F7F5EE;
    border: 1px solid rgba(122, 182, 72, 0.18);
    border-radius: 12px;
    box-shadow:
        0 20px 60px rgba(6, 18, 41, 0.55),
        0 0 0 1px rgba(122, 182, 72, 0.08),
        0 0 40px rgba(122, 182, 72, 0.06);
    padding: 32px 28px 24px;
    margin-top: 0;
    font-weight: normal;
    overflow: hidden;
    position: relative;
}

/* Green accent stripe along the top of the card */
body.login #loginform::before,
body.login #registerform::before,
body.login #lostpasswordform::before,
body.login #resetpassform::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #7AB648 0%, #D4AF37 50%, #7AB648 100%);
}


/* ─── 5. FORM LABELS ──────────────────────────────────────────────────────── */

body.login label {
    color: #0a1f44;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-shadow: none;
    margin-bottom: 4px;
    display: block;
}

body.login .forgetmenot label {
    font-weight: 500;
    color: #4a5a75;
    font-size: 13px;
}


/* ─── 6. TEXT INPUTS ──────────────────────────────────────────────────────── */

body.login input[type="text"],
body.login input[type="email"],
body.login input[type="password"],
body.login input[type="tel"],
body.login input[type="url"],
body.login input[type="number"] {
    background: #ffffff !important;
    border: 1.5px solid #d8dde5 !important;
    border-radius: 8px !important;
    color: #0a1f44 !important;
    font-size: 15px !important;
    font-weight: 500;
    padding: 12px 14px !important;
    margin-top: 4px !important;
    margin-bottom: 14px !important;
    box-shadow: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    line-height: 1.4;
    height: auto !important;
}

body.login input[type="text"]:focus,
body.login input[type="email"]:focus,
body.login input[type="password"]:focus,
body.login input[type="tel"]:focus,
body.login input[type="url"]:focus,
body.login input[type="number"]:focus {
    border-color: #0a1f44 !important;
    box-shadow: 0 0 0 3px rgba(122, 182, 72, 0.18) !important;
    outline: none !important;
    background: #ffffff !important;
}

body.login input[type="text"]::placeholder,
body.login input[type="email"]::placeholder,
body.login input[type="password"]::placeholder {
    color: #9ba7bb;
    font-weight: 400;
}

/* Password visibility toggle button — align with new input styles */
body.login .wp-pwd {
    position: relative;
}

body.login .wp-pwd button.button {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #0a1f44 !important;
    position: absolute;
    right: 4px;
    top: 4px;
    height: calc(100% - 8px);
    padding: 0 10px;
    transition: color 0.2s ease;
}

body.login .wp-pwd button.button:hover,
body.login .wp-pwd button.button:focus {
    color: #7AB648 !important;
    outline: none !important;
}

body.login .wp-pwd .dashicons {
    font-size: 20px;
    line-height: 1;
}


/* ─── 7. REMEMBER-ME CHECKBOX ────────────────────────────────────────────── */

body.login .forgetmenot {
    margin: 4px 0 18px;
    line-height: 1.6;
    float: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.login .forgetmenot input[type="checkbox"] {
    accent-color: #7AB648;
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}


/* ─── 8. SUBMIT BUTTON — the primary action ──────────────────────────────── */

body.login .wp-core-ui .button-primary,
body.login #wp-submit {
    background: linear-gradient(180deg, #7AB648 0%, #5A8635 100%) !important;
    border: 0 !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    padding: 14px 20px !important;
    height: auto !important;
    line-height: 1 !important;
    width: 100%;
    box-shadow:
        0 4px 14px rgba(122, 182, 72, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
    text-shadow: none !important;
    cursor: pointer;
    transition: all 0.2s ease;
    float: none !important;
    margin-top: 6px;
}

body.login .wp-core-ui .button-primary:hover,
body.login #wp-submit:hover,
body.login .wp-core-ui .button-primary:focus,
body.login #wp-submit:focus {
    background: linear-gradient(180deg, #D4AF37 0%, #b89530 100%) !important;
    color: #061229 !important;
    box-shadow:
        0 6px 20px rgba(212, 175, 55, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-1px);
    outline: none !important;
}

body.login .wp-core-ui .button-primary:active,
body.login #wp-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(122, 182, 72, 0.3) !important;
}

/* Submit-row layout: button spans full width, no left-float */
body.login .submit,
body.login p.submit {
    text-align: center;
    margin-top: 8px;
    margin-bottom: 4px;
}


/* ─── 9. LINKS BELOW THE FORM (lost password, back to KE) ─────────────────── */

body.login #nav,
body.login #backtoblog {
    margin: 18px 0 0 !important;
    padding: 0 !important;
    text-align: center;
    text-shadow: none;
    font-size: 13px;
}

body.login #nav {
    margin-top: 22px !important;
}

body.login #nav a,
body.login #backtoblog a {
    color: #D4AF37 !important;
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: color 0.2s ease, border-bottom-color 0.2s ease;
    border-bottom: 1px solid transparent;
    padding-bottom: 1px;
}

body.login #nav a:hover,
body.login #backtoblog a:hover,
body.login #nav a:focus,
body.login #backtoblog a:focus {
    color: #7AB648 !important;
    border-bottom-color: #7AB648;
    outline: none;
}

/* Divider between "Lost your password?" and "Back to..." when both render */
body.login #nav {
    color: rgba(232, 236, 243, 0.35);
}


/* ─── 10. MESSAGES: error, success, info banners ─────────────────────────── */

body.login .message,
body.login #login_error,
body.login .notice,
body.login .success {
    background: #F7F5EE !important;
    border-left: 4px solid #7AB648 !important;
    border-radius: 8px !important;
    color: #0a1f44 !important;
    font-size: 13.5px;
    padding: 12px 16px !important;
    margin: 0 0 18px !important;
    box-shadow: 0 8px 24px rgba(6, 18, 41, 0.35) !important;
    line-height: 1.5;
}

body.login #login_error {
    border-left-color: #b32d2e !important;
    color: #7a1c1d !important;
}

body.login #login_error a,
body.login .message a,
body.login .notice a {
    color: #0a1f44 !important;
    font-weight: 600;
    text-decoration: underline;
}


/* ─── 11. LANGUAGE SWITCHER (if enabled) ─────────────────────────────────── */

body.login .language-switcher {
    margin-top: 16px;
    text-align: center;
}

body.login .language-switcher label,
body.login .language-switcher select {
    color: rgba(232, 236, 243, 0.75) !important;
    background: transparent !important;
    border-color: rgba(232, 236, 243, 0.2) !important;
}

body.login .language-switcher input[type="submit"] {
    background: transparent !important;
    color: #D4AF37 !important;
    border: 1px solid rgba(212, 175, 55, 0.4) !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    text-shadow: none !important;
}


/* ─── 12. PRIVACY POLICY LINK (WP 4.9.6+) ────────────────────────────────── */

body.login .privacy-policy-page-link {
    margin-top: 24px !important;
    text-align: center;
    color: rgba(232, 236, 243, 0.55);
    font-size: 12px;
}

body.login .privacy-policy-page-link a {
    color: rgba(212, 175, 55, 0.75) !important;
    text-decoration: none;
    transition: color 0.2s ease;
}

body.login .privacy-policy-page-link a:hover {
    color: #D4AF37 !important;
    text-decoration: underline;
}


/* ─── 13. INTERIM LOGIN MODAL (session-expired popup) ────────────────────── */

body.interim-login #login {
    padding-top: 24px;
}

body.interim-login h1 a {
    width: 240px !important;
    height: 75px !important;
    margin-bottom: 16px !important;
}


/* ─── 14. RESPONSIVE — mobile-safe ───────────────────────────────────────── */

@media (max-width: 480px) {
    body.login #login {
        width: 92vw;
        padding-top: 4vh;
    }
    body.login h1 a {
        width: 260px !important;
        height: 82px !important;
    }
    body.login #loginform,
    body.login #registerform,
    body.login #lostpasswordform,
    body.login #resetpassform {
        padding: 24px 20px 20px;
        border-radius: 10px;
    }
    body.login input[type="text"],
    body.login input[type="email"],
    body.login input[type="password"] {
        font-size: 16px !important; /* iOS zoom-suppress threshold */
    }
    body.login::after {
        bottom: 12px;
        right: 14px;
        font-size: 10px;
    }
}

@media (max-height: 640px) {
    body.login #login {
        padding-top: 3vh;
    }
    body.login h1 a {
        margin-bottom: 16px !important;
    }
}


/* ─── 15. HIGH-CONTRAST / REDUCED-MOTION ACCESSIBILITY ───────────────────── */

@media (prefers-reduced-motion: reduce) {
    body.login h1 a,
    body.login .wp-core-ui .button-primary,
    body.login #wp-submit,
    body.login #nav a,
    body.login #backtoblog a,
    body.login input {
        transition: none !important;
    }
    body.login .wp-core-ui .button-primary:hover,
    body.login #wp-submit:hover {
        transform: none;
    }
}


/* ─── 16. HIDE the small horizontal rule between forms if WP renders one ── */

body.login hr {
    border: 0;
    border-top: 1px solid rgba(232, 236, 243, 0.15);
    margin: 20px 0;
}


/* ─── 17. AUTOFILL — override the ugly yellow Chrome default ─────────────── */

body.login input:-webkit-autofill,
body.login input:-webkit-autofill:hover,
body.login input:-webkit-autofill:focus {
    -webkit-text-fill-color: #0a1f44 !important;
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    box-shadow: 0 0 0 1000px #ffffff inset !important;
    caret-color: #0a1f44;
    border-color: #d8dde5 !important;
}


/* ═══════════════════════════════════════════════════════════════════════════
 * END login-styles.css
 * If this file needs to be rolled back, remove the `wp_enqueue_style` line
 * for 'kingdomedge-login' in functions.php (search "login_enqueue_scripts").
 * ═══════════════════════════════════════════════════════════════════════════ */
