/* ===========================================================================
   Afryx — branded split-screen login
   (applied by afryx_login.js on /login; the Frappe auth form is reused as-is)
   =========================================================================== */
/* Hide the stock page until the split skin is built — prevents the flash of
   the plain Frappe card on load. afryx_login.js reveals it by adding
   .afryx-login-active (skin built) or .afryx-login-fallback (skin failed). */
body[data-path="login"]:not(.afryx-login-active):not(.afryx-login-fallback) .page-content-wrapper {
    visibility: hidden;
}

body.afryx-login-active {
    margin: 0;
    overflow: hidden;
}
body.afryx-login-active .navbar,
body.afryx-login-active footer,
body.afryx-login-active .web-footer { display: none !important; }

.afryx-login-split {
    position: fixed;
    inset: 0;
    display: flex;
    background: #ffffff;
    z-index: 100;
    font-family: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
}

/* ---- left brand panel: photo of the team, brand overlay on top ---- */
.afryx-login-brand {
    position: relative;
    flex: 1 1 58%;
    color: #fff;
    padding: 52px 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    background:
        linear-gradient(135deg, #1f9bcf 0%, #167fae 45%, #0f4f74 100%);
}
/* photo layer (served from site files; gradient above is the fallback) */
.afryx-login-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("/files/login-bg.jpg") center 30% / cover no-repeat;
    pointer-events: none;
}
/* legibility overlay above the photo */
.afryx-login-brand::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(200deg, rgba(10, 45, 66, .30) 0%, rgba(10, 45, 66, .62) 55%, rgba(6, 30, 46, .88) 100%);
    pointer-events: none;
}
.afryx-login-brand-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.afryx-login-logo { display: flex; align-items: center; gap: 12px; }
.afryx-login-logo .afryx-login-badge {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 7px 10px; border-radius: 12px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .25);
}
.afryx-login-logo-img { height: 30px; width: auto; display: block; }
.afryx-login-logo b { font-size: 18px; letter-spacing: .2px; color: #fff !important; text-shadow: 0 1px 12px rgba(0, 0, 0, .4); }

.afryx-login-hero h1 {
    font-size: 42px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; margin: 0 0 18px;
    color: #fff !important;
    text-shadow: 0 2px 24px rgba(0, 0, 0, .45);
}
.afryx-login-hero p {
    font-size: 16px; line-height: 1.65; max-width: 470px; margin: 0;
    color: rgba(255, 255, 255, .92) !important;
    text-shadow: 0 1px 12px rgba(0, 0, 0, .45);
}

.afryx-login-stats { display: flex; gap: 44px; }
.afryx-login-stats b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.01em; color: #fff !important; text-shadow: 0 1px 12px rgba(0, 0, 0, .4); }
.afryx-login-stats span { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: rgba(255, 255, 255, .8) !important; }

/* ---- right form panel ---- */
.afryx-login-form {
    flex: 1 1 42%;
    max-width: 540px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 56px 20px;
    background: #ffffff;
}
.afryx-login-form-inner {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.afryx-login-form-inner > div,
.afryx-login-form section { width: 100%; }
/* the Solvronix observer sets inline min-height:100vh/padding when a view is
   shown — !important beats inline styles and keeps views inside our panel */
.afryx-login-form section {
    min-height: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}
.afryx-login-form .page-card,
.afryx-login-form .page-card-container,
.afryx-login-form .login-content {
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
    width: 100% !important;
    max-width: 360px;
    padding: 0 !important;
    margin: 0 !important;
}
.afryx-login-form .page-card-head { display: none !important; }

/* welcome heading (with site logo) injected before the form */
.afryx-login-welcome { margin-bottom: 24px; text-align: center; }
.afryx-login-form-logo { height: 60px; width: auto; display: block; margin: 0 auto 16px; }
.afryx-login-welcome h2 { font-size: 26px; font-weight: 800; margin: 0 0 4px; color: #14202c; }
.afryx-login-welcome p { color: #6b7280; font-size: 14px; margin: 0; }

/* inputs */
.afryx-login-form .form-control,
.afryx-login-form input.form-control {
    height: 46px; border-radius: 10px; border: 1px solid #e1e7ef; background: #f7f9fc;
    font-size: 14px; padding: 0 14px;
}
.afryx-login-form .form-control:focus { border-color: #1f9bcf; box-shadow: 0 0 0 3px rgba(31, 155, 207, .15); background: #fff; }
.afryx-login-form .form-group, .afryx-login-form .form-signin-group { margin-bottom: 14px; }
.afryx-login-form label { font-size: 12.5px; font-weight: 600; color: #4b5563; margin-bottom: 5px; }

/* primary button (brand) */
.afryx-login-form .btn-login,
.afryx-login-form .btn-primary,
.afryx-login-form .btn-modal-primary {
    height: 46px; border-radius: 10px; font-weight: 600; font-size: 15px;
    background: linear-gradient(135deg, #1f9bcf, #167fae) !important;
    border: none !important; box-shadow: 0 6px 16px rgba(31, 155, 207, .35) !important;
    transition: transform .12s ease, box-shadow .12s ease;
}
.afryx-login-form .btn-login:hover,
.afryx-login-form .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(31, 155, 207, .45) !important; }
.afryx-login-form a { color: #1f9bcf; }

/* footer credit */
.afryx-login-footer {
    padding: 14px 0 6px;
    font-size: 12.5px;
    color: #9aa4b2;
    text-align: center;
}
.afryx-login-footer b { color: #6b7280; font-weight: 600; }
.afryx-login-footer a { color: #1f9bcf; text-decoration: none; }
.afryx-login-footer a b { color: inherit; }
.afryx-login-footer a:hover { text-decoration: underline; }

/* responsive: stack on small screens */
@media (max-width: 880px) {
    .afryx-login-split { flex-direction: column; overflow: auto; }
    .afryx-login-brand { flex: 0 0 auto; padding: 26px 26px; }
    .afryx-login-hero h1 { font-size: 28px; }
    .afryx-login-hero p, .afryx-login-stats { display: none; }
    .afryx-login-form { flex: 1; max-width: none; padding: 26px 26px 12px; }
}
