/*
Theme Name: AIT CRM SYSTEM
Theme URI: https://crm.ait-webdesign.com/
Author: AIT Web Design
Description: Private CRM login and administration theme for AIT CRM SYSTEM.
Version: 1.3.9
Text Domain: ait-crm-system
Requires at least: 6.0
Requires PHP: 7.4
*/

:root {
    --ait-bg: #0d0f12;
    --ait-bg-glow-1: rgba(255, 255, 255, 0.05);
    --ait-bg-glow-2: rgba(255, 255, 255, 0.04);
    --ait-panel: rgba(23, 26, 31, 0.96);
    --ait-border: rgba(255, 255, 255, 0.10);
    --ait-text: #f3f4f6;
    --ait-muted: #9ca3af;
    --ait-input-bg: #101318;
    --ait-input-text: #f3f4f6;
    --ait-input-focus: rgba(255, 255, 255, 0.45);
    --ait-focus-ring: rgba(255, 255, 255, 0.06);
    --ait-accent: #ffffff;
    --ait-accent-text: #0d0f12;
    --ait-footer: #6b7280;
    --ait-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
    --ait-danger-bg: rgba(220, 38, 38, 0.12);
    --ait-danger-border: rgba(248, 113, 113, 0.30);
    --ait-danger-text: #fecaca;
}

body.aitcrm-theme-light {
    --ait-bg: #f2f4f7;
    --ait-bg-glow-1: rgba(17, 24, 39, 0.035);
    --ait-bg-glow-2: rgba(17, 24, 39, 0.025);
    --ait-panel: rgba(255, 255, 255, 0.97);
    --ait-border: rgba(17, 24, 39, 0.12);
    --ait-text: #161a20;
    --ait-muted: #667085;
    --ait-input-bg: #f8fafc;
    --ait-input-text: #111827;
    --ait-input-focus: rgba(17, 24, 39, 0.32);
    --ait-focus-ring: rgba(17, 24, 39, 0.07);
    --ait-accent: #171a1f;
    --ait-accent-text: #ffffff;
    --ait-footer: #77808f;
    --ait-shadow: 0 24px 70px rgba(15, 23, 42, 0.13);
    --ait-danger-bg: rgba(220, 38, 38, 0.07);
    --ait-danger-border: rgba(220, 38, 38, 0.22);
    --ait-danger-text: #991b1b;
}

@media (prefers-color-scheme: light) {
    body.aitcrm-theme-auto {
        --ait-bg: #f2f4f7;
        --ait-bg-glow-1: rgba(17, 24, 39, 0.035);
        --ait-bg-glow-2: rgba(17, 24, 39, 0.025);
        --ait-panel: rgba(255, 255, 255, 0.97);
        --ait-border: rgba(17, 24, 39, 0.12);
        --ait-text: #161a20;
        --ait-muted: #667085;
        --ait-input-bg: #f8fafc;
        --ait-input-text: #111827;
        --ait-input-focus: rgba(17, 24, 39, 0.32);
        --ait-focus-ring: rgba(17, 24, 39, 0.07);
        --ait-accent: #171a1f;
        --ait-accent-text: #ffffff;
        --ait-footer: #77808f;
        --ait-shadow: 0 24px 70px rgba(15, 23, 42, 0.13);
        --ait-danger-bg: rgba(220, 38, 38, 0.07);
        --ait-danger-border: rgba(220, 38, 38, 0.22);
        --ait-danger-text: #991b1b;
    }
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body.aitcrm-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    isolation: isolate;
    background-color: var(--ait-bg-color-dark, var(--ait-bg));
    background-image:
        radial-gradient(circle at top left, var(--ait-bg-glow-1), transparent 32%),
        radial-gradient(circle at bottom right, var(--ait-bg-glow-2), transparent 30%),
        var(--ait-bg-image-dark, none);
    background-size: auto, auto, var(--ait-bg-size, cover);
    background-position: top left, bottom right, var(--ait-bg-position, center center);
    background-repeat: no-repeat, no-repeat, var(--ait-bg-repeat, no-repeat);
    background-attachment: scroll, scroll, var(--ait-bg-attachment, fixed);
    background-origin: padding-box, padding-box, var(--ait-bg-origin, padding-box);
    background-clip: border-box, border-box, var(--ait-bg-clip, border-box);
    background-blend-mode: normal, normal, var(--ait-bg-blend-mode, normal);
    color: var(--ait-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body.aitcrm-login-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: var(--ait-overlay-dark, #0d0f12);
    opacity: var(--ait-overlay-dark-opacity, .35);
}

body.aitcrm-theme-light {
    background-color: var(--ait-bg-color-light, var(--ait-bg));
    background-image:
        radial-gradient(circle at top left, var(--ait-bg-glow-1), transparent 32%),
        radial-gradient(circle at bottom right, var(--ait-bg-glow-2), transparent 30%),
        var(--ait-bg-image-light, none);
}

body.aitcrm-theme-light::before {
    background: var(--ait-overlay-light, #ffffff);
    opacity: var(--ait-overlay-light-opacity, .15);
}

@media (prefers-color-scheme: light) {
    body.aitcrm-theme-auto {
        background-color: var(--ait-bg-color-light, var(--ait-bg));
        background-image:
            radial-gradient(circle at top left, var(--ait-bg-glow-1), transparent 32%),
            radial-gradient(circle at bottom right, var(--ait-bg-glow-2), transparent 30%),
            var(--ait-bg-image-light, none);
    }

    body.aitcrm-theme-auto::before {
        background: var(--ait-overlay-light, #ffffff);
        opacity: var(--ait-overlay-light-opacity, .15);
    }
}

.aitcrm-login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 430px;
}

.aitcrm-brand {
    text-align: center;
}

.aitcrm-brand__title {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.08em;
}

.aitcrm-brand__subtitle {
    margin: 10px 0 0;
    color: var(--ait-muted);
    font-size: 14px;
    letter-spacing: 0.04em;
}


.aitcrm-brand__logos {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
}

.aitcrm-brand__logo {
    display: block;
    width: auto;
    max-width: min(var(--ait-logo-width, 210px), 100%);
    object-fit: contain;
}

.aitcrm-brand__logo--light {
    display: none;
}

body.aitcrm-theme-light .aitcrm-brand__logo--dark {
    display: none;
}

body.aitcrm-theme-light .aitcrm-brand__logo--light {
    display: block;
}

@media (prefers-color-scheme: light) {
    body.aitcrm-theme-auto .aitcrm-brand__logo--dark {
        display: none;
    }

    body.aitcrm-theme-auto .aitcrm-brand__logo--light {
        display: block;
    }
}

.aitcrm-login-card {
    padding: 32px;
    border: 1px solid var(--ait-border);
    border-radius: 18px;
    background: var(--ait-panel);
    box-shadow: var(--ait-shadow);
}

.aitcrm-login-card h1 {
    margin: 0 0 8px;
    font-size: 22px;
    line-height: 1.3;
}

.aitcrm-login-card__intro {
    margin: 0 0 24px;
    color: var(--ait-muted);
    font-size: 14px;
    line-height: 1.6;
}

.aitcrm-field {
    margin-bottom: 18px;
}

.aitcrm-field label {
    display: block;
    margin-bottom: 8px;
    color: var(--ait-text);
    font-size: 13px;
    font-weight: 600;
}

.aitcrm-field input[type="text"],
.aitcrm-field input[type="password"] {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--ait-border);
    border-radius: 10px;
    outline: none;
    background: var(--ait-input-bg);
    color: var(--ait-input-text);
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.aitcrm-field input:focus {
    border-color: var(--ait-input-focus);
    box-shadow: 0 0 0 3px var(--ait-focus-ring);
}

.aitcrm-remember {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 4px 0 22px;
    color: var(--ait-muted);
    font-size: 13px;
}

.aitcrm-remember input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.aitcrm-submit {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    background: var(--ait-accent);
    color: var(--ait-accent-text);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.aitcrm-submit:hover {
    opacity: 0.92;
}

.aitcrm-submit:active {
    transform: translateY(1px);
}

.aitcrm-error {
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid var(--ait-danger-border);
    border-radius: 10px;
    background: var(--ait-danger-bg);
    color: var(--ait-danger-text);
    font-size: 13px;
    line-height: 1.5;
}

.aitcrm-footer-note {
    margin: 18px 0 0;
    color: var(--ait-footer);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

@media (max-width: 520px) {
    body.aitcrm-login-page {
        padding: 16px;
    }

    .aitcrm-login-card {
        padding: 24px 20px;
    }
}


/* ==========================================================
 * AIT CRM SYSTEM v1.3.5 — Stable login stack anchor
 * ==========================================================
 *
 * The normal CRM login and Kadence 2FA have different card heights.
 * Centering the whole stack vertically therefore moves the logo between
 * screens. Both screens now start from the exact same viewport Y anchor.
 */

body.aitcrm-login-page {
    --ait-login-stack-top: clamp(56px, 8vh, 88px);
    align-items: flex-start !important;
    justify-content: center !important;
    min-height: 100vh !important;
    height: auto !important;
    padding-top: var(--ait-login-stack-top) !important;
    padding-bottom: 32px !important;
}

/* Normal CRM login stack. */
.aitcrm-login-shell {
    margin: 0 auto !important;
    align-self: flex-start !important;
}

.aitcrm-brand {
    margin: 0 0 28px !important;
}

/*
 * Do not let the brand wrapper introduce an unrelated minimum height.
 * The real image dimensions + the explicit 28px gap define the geometry.
 */
.aitcrm-brand__logos {
    min-height: 0 !important;
}

/* Small screens still use a stable top anchor, just closer to the top. */
@media (max-width: 520px) {
    body.aitcrm-login-page {
        --ait-login-stack-top: 28px;
        padding-top: var(--ait-login-stack-top) !important;
        padding-bottom: 24px !important;
    }

    .aitcrm-brand {
        margin-bottom: 22px !important;
    }
}

/* Short-height displays: keep the form reachable without vertical clipping. */
@media (max-height: 760px) and (min-width: 521px) {
    body.aitcrm-login-page {
        --ait-login-stack-top: 28px;
    }
}
