/* =========================================================
   CoreSync Construction — Branded Split-Layout Login Page
   Injected via web_include_css (applies to /login only)
   ========================================================= */

/* ── Reset & base ─────────────────────────────────────────── */
.csh-login-wrapper *,
.csh-login-wrapper *::before,
.csh-login-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Full-screen wrapper ──────────────────────────────────── */
.csh-login-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
}

/* ── Hide Frappe's own page chrome on login ──────────────── */
/* NOTE: Do NOT list .login-content or .for-login here —
   our JS moves those INTO .csh-login-form-wrap where they
   must stay visible. Only hide the outer shell elements.   */
body.csh-login-active .navbar,
body.csh-login-active .page-container > .container,
body.csh-login-active footer,
body.csh-login-active .web-footer {
    display: none !important;
}

/* Hide Frappe's built-in logo block & "Login to <app>" heading
   inside our wrapper — we provide our own heading             */
.csh-login-form-wrap .page-card-head {
    display: none !important;
}

body.csh-login-active {
    background: #fff;
    overflow-x: hidden;
}

/* ── LEFT PANEL ───────────────────────────────────────────── */
.csh-login-left {
    flex: 0 0 48%;
    max-width: 48%;
    background: #004368;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 56px 52px;
    position: relative;
    overflow: hidden;
}

/* Subtle geometric accent — large teal circle top-right */
.csh-login-left::before {
    content: "";
    position: absolute;
    top: -120px;
    right: -120px;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: rgba(0, 138, 138, 0.15);
    pointer-events: none;
}

/* Small circle bottom-left */
.csh-login-left::after {
    content: "";
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(0, 138, 138, 0.10);
    pointer-events: none;
}

/* ── Logo area ────────────────────────────────────────────── */
.csh-logo-area {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.csh-logo-img {
    width: 200px;
    max-width: 100%;
    display: block;
    /* SVG has transparent bg — sits cleanly on navy */
}

.csh-logo-product {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin-left: 2px;
}

/* ── Hero copy ────────────────────────────────────────────── */
.csh-hero {
    position: relative;
    z-index: 1;
    margin-top: -32px; /* visually center between logo and bullets */
}

.csh-hero-tagline {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    margin-bottom: 12px;
    max-width: 380px;
}

.csh-hero-tagline .csh-accent {
    color: #008A8A;
}

.csh-hero-sub {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.6;
    max-width: 360px;
}

/* ── Feature bullets ──────────────────────────────────────── */
.csh-features {
    position: relative;
    z-index: 1;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.csh-feature-item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.csh-feature-icon {
    width: 36px;
    height: 36px;
    background: rgba(0, 138, 138, 0.25);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #008A8A;
    font-size: 16px;
}

/* Use tabler icons if available, else Unicode fallback */
.csh-feature-icon .ti {
    color: #4DDBDB;
    font-size: 18px;
}

.csh-feature-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    line-height: 1.3;
}

/* ── Footer credit ────────────────────────────────────────── */
.csh-left-footer {
    position: relative;
    z-index: 1;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.5px;
}

/* ── RIGHT PANEL ──────────────────────────────────────────── */
.csh-login-right {
    flex: 1;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 52px;
}

.csh-login-form-wrap {
    width: 100%;
    max-width: 380px;
}

/* ── Right panel heading ──────────────────────────────────── */
.csh-login-heading {
    margin-bottom: 32px;
}

.csh-login-heading h2 {
    font-size: 26px;
    font-weight: 700;
    color: #0f1923;
    margin-bottom: 6px;
}

.csh-login-heading p {
    font-size: 14px;
    color: #6b7280;
}

/* ── Override Frappe's native form styles inside our wrapper ─ */
/* Force visibility — these are moved inside .csh-login-form-wrap
   by coresync_login.js and must NOT be hidden.                  */
.csh-login-form-wrap .login-content,
.csh-login-form-wrap .login-main-section,
.csh-login-form-wrap #login-area,
.csh-login-form-wrap .for-login,
.csh-login-form-wrap .page-card,
.csh-login-form-wrap .form-signin {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: unset !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.csh-login-form-wrap .container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
}

.csh-login-form-wrap .row {
    margin: 0 !important;
}

.csh-login-form-wrap .page_content,
.csh-login-form-wrap .page-content-wrapper {
    padding: 0 !important;
}

/* Frappe v15 form card */
.csh-login-form-wrap .card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
}

.csh-login-form-wrap .card-body {
    padding: 0 !important;
}

/* Form heading — hide Frappe's own */
.csh-login-form-wrap h1.title-text,
.csh-login-form-wrap .login-content h1 {
    display: none !important;
}

/* Input fields */
.csh-login-form-wrap .form-control,
.csh-login-form-wrap input[type="email"],
.csh-login-form-wrap input[type="text"],
.csh-login-form-wrap input[type="password"] {
    border: 1.5px solid #e0e3e8 !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    color: #0f1923 !important;
    background: #f9fafb !important;
    transition: border-color 0.2s ease !important;
    box-shadow: none !important;
}

.csh-login-form-wrap .form-control:focus,
.csh-login-form-wrap input[type="email"]:focus,
.csh-login-form-wrap input[type="text"]:focus,
.csh-login-form-wrap input[type="password"]:focus {
    border-color: #008A8A !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(0, 138, 138, 0.12) !important;
    outline: none !important;
}

/* Labels */
.csh-login-form-wrap label {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 6px !important;
}

/* Primary login button */
.csh-login-form-wrap .btn-login-area,
.csh-login-form-wrap button[data-label="Login"],
.csh-login-form-wrap .btn-primary,
.csh-login-form-wrap input[type="submit"] {
    background: #004368 !important;
    border-color: #004368 !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    padding: 11px 24px !important;
    width: 100% !important;
    transition: background 0.2s ease, box-shadow 0.2s ease !important;
    cursor: pointer !important;
    letter-spacing: 0.3px !important;
}

.csh-login-form-wrap .btn-login-area:hover,
.csh-login-form-wrap button[data-label="Login"]:hover,
.csh-login-form-wrap .btn-primary:hover,
.csh-login-form-wrap input[type="submit"]:hover {
    background: #005a8a !important;
    border-color: #005a8a !important;
    box-shadow: 0 4px 12px rgba(0, 67, 104, 0.3) !important;
}

/* ── Hide "Login with Frappe Cloud" button ────────────────── */
.csh-login-form-wrap .btn-frappe-cloud,
.csh-login-form-wrap a[href*="frappe-cloud"],
.csh-login-form-wrap a[href*="oauth"],
[class*="frappe-cloud"],
.login-with-frappe-cloud,
.btn-social-login {
    display: none !important;
}

/* Forgot password link */
.csh-login-form-wrap .forgot-password,
.csh-login-form-wrap a.forgot-password,
.csh-login-form-wrap .forgot-pass-link {
    color: #008A8A !important;
    font-size: 13px !important;
    text-decoration: none !important;
}

.csh-login-form-wrap .forgot-password:hover,
.csh-login-form-wrap a.forgot-password:hover {
    text-decoration: underline !important;
}

/* Form group spacing */
.csh-login-form-wrap .form-group {
    margin-bottom: 18px !important;
}

/* Alert / error messages */
.csh-login-form-wrap .alert {
    border-radius: 8px !important;
    font-size: 13px !important;
    margin-bottom: 16px !important;
}

/* ── Responsive: stack at 768px ───────────────────────────── */
@media (max-width: 768px) {
    .csh-login-wrapper {
        flex-direction: column;
    }

    .csh-login-left {
        flex: none;
        max-width: 100%;
        padding: 36px 28px;
        min-height: auto;
    }

    .csh-hero {
        margin-top: 24px;
    }

    .csh-hero-tagline {
        font-size: 24px;
    }

    .csh-features {
        margin: 24px 0;
    }

    .csh-left-footer {
        display: none; /* saves space on mobile */
    }

    .csh-login-right {
        padding: 36px 28px;
    }
}
