/* KAYANZA FAMILY TRANSPORT login — desktop split + mobile stack */

:root {
    --login-primary: #4f46e5;
    --login-primary-dark: #4338ca;
    --login-primary-light: #6366f1;
    --login-text: #111827;
    --login-text-muted: #6b7280;
    --login-border: #d1d5db;
    --login-bg: #f3f4f8;
    --login-card-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.18);
    --login-radius: 12px;
    --login-input-h: 48px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body.login-body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--login-text);
    background: var(--login-bg);
    -webkit-font-smoothing: antialiased;
}

/* Page background dots (desktop reference) */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 48px;
    position: relative;
    overflow-x: hidden;
}

.login-page::before,
.login-page::after {
    content: '';
    position: fixed;
    width: 220px;
    height: 220px;
    opacity: 0.35;
    pointer-events: none;
    background-image: radial-gradient(var(--login-primary) 1.5px, transparent 1.5px);
    background-size: 14px 14px;
}

.login-page::before {
    top: 24px;
    left: 24px;
}

.login-page::after {
    bottom: 56px;
    right: 24px;
}

/* Main card */
.login-shell {
    width: 100%;
    max-width: 1080px;
    position: relative;
    z-index: 1;
}

.login-card {
    display: grid;
    grid-template-columns: minmax(300px, 46%) 1fr;
    position: relative;
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--login-card-shadow);
    overflow: hidden;
    min-height: 620px;
    isolation: isolate;
}

/* —— Brand panel (desktop left) —— */
.login-brand {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    z-index: 3;
    color: #fff;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 45%, #312e81 100%);
}

/* Decorative diagonal edge — opaque, sits over seam (no clip-path on panel) */
.login-brand::after {
    content: '';
    position: absolute;
    top: 0;
    right: -36px;
    width: 72px;
    height: 100%;
    background: linear-gradient(135deg, #4338ca 0%, #312e81 100%);
    clip-path: polygon(0 0, 100% 0, 0 100%);
    pointer-events: none;
    z-index: 4;
}

/* Opaque fill — no transparency, no external images */
.login-brand__overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(135deg, #4f46e5 0%, #4338ca 45%, #312e81 100%),
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.06) 0%, transparent 40%);
}

.login-brand__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    min-height: 100%;
    padding: 40px 36px 32px;
}

.login-brand__top {
    position: relative;
}

.login-brand__logo {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 28px;
}

.login-brand__identity {
    min-width: 0;
    flex: 1;
}

.login-brand__logo svg {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

.login-brand__title {
    margin: 0;
    font-size: clamp(1.05rem, 2.2vw, 1.35rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.25;
    text-wrap: balance;
}

.login-brand__subtitle {
    margin: 6px 0 0;
    font-size: 0.92rem;
    font-weight: 500;
    opacity: 0.95;
    line-height: 1.35;
}

.login-brand__pitch {
    margin-top: auto;
    padding-top: 32px;
}

.login-brand__pitch-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    font-size: 1.1rem;
}

.login-brand__tagline {
    margin: 0 0 10px;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
}

.login-brand__description {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    opacity: 0.92;
    max-width: 340px;
}

.login-brand__features {
    display: flex;
    gap: 24px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.login-brand__feature {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.95;
}

.login-brand__feature i {
    font-size: 1.15rem;
    opacity: 0.95;
}

/* —— Form panel —— */
.login-form-panel {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 52px;
    background: #fff;
    min-width: 0;
    overflow: hidden;
    contain: paint;
}

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

.login-form-wrap h1 {
    margin: 0 0 6px;
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--login-text);
}

.login-form-wrap .login-lead {
    margin: 0 0 28px;
    font-size: 0.95rem;
    color: var(--login-text-muted);
}

.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 20px;
    border-radius: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.875rem;
    line-height: 1.4;
}

.login-alert i {
    margin-top: 2px;
}

.login-field {
    margin-bottom: 20px;
}

.login-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--login-text);
}

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-wrap > i.field-icon {
    position: absolute;
    left: 14px;
    color: #9ca3af;
    font-size: 0.95rem;
    pointer-events: none;
}

.login-input-wrap input {
    width: 100%;
    height: var(--login-input-h);
    padding: 0 44px 0 42px;
    border: 1px solid var(--login-border);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--login-text);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.login-input-wrap input::placeholder {
    color: #9ca3af;
}

.login-input-wrap input:focus {
    outline: none;
    border-color: var(--login-primary-light);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.login-toggle-pw {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    padding: 6px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
}

.login-toggle-pw:hover {
    color: var(--login-primary);
}

.login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 12px;
    flex-wrap: wrap;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--login-text-muted);
    cursor: pointer;
    user-select: none;
}

.login-remember input {
    width: 16px;
    height: 16px;
    accent-color: var(--login-primary);
    cursor: pointer;
}

.login-forgot {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--login-primary);
    text-decoration: none;
}

.login-forgot:hover {
    text-decoration: underline;
}

.btn-login-primary {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 10px;
    background: var(--login-primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.btn-login-primary:hover {
    background: var(--login-primary-dark);
}

.btn-login-primary:active {
    transform: scale(0.99);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0;
    color: #9ca3af;
    font-size: 0.8rem;
    font-weight: 500;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.btn-login-outline {
    width: 100%;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px solid var(--login-primary);
    border-radius: 10px;
    background: #fff;
    color: var(--login-primary);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-login-outline:hover {
    background: rgba(79, 70, 229, 0.06);
}

.login-page-footer {
    margin-top: 28px;
    text-align: center;
    font-size: 0.8rem;
    color: #9ca3af;
    position: relative;
    z-index: 1;
}

/* Mobile feature strip (inside form card on mobile) */
.login-mobile-features {
    display: none;
}

/* —— Mobile layout (reference image) —— */
@media (max-width: 900px) {
    .login-page {
        padding: 0;
        justify-content: flex-start;
        background: #fff;
    }

    .login-page::before,
    .login-page::after {
        display: none;
    }

    .login-shell {
        max-width: none;
        width: 100%;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .login-card {
        display: flex;
        flex-direction: column;
        border-radius: 0;
        box-shadow: none;
        min-height: 100vh;
    }

    .login-brand {
        grid-column: auto;
        grid-row: auto;
        flex: none;
        z-index: 1;
        padding: 0;
    }

    .login-brand::after {
        right: 0;
        width: auto;
        height: 36px;
        top: auto;
        bottom: -1px;
        left: 0;
        background: #fff;
        border-radius: 28px 28px 0 0;
        clip-path: none;
        z-index: 2;
    }

    .login-brand__logo {
        flex-direction: column;
        align-items: center;
        margin-bottom: 12px;
    }

    .login-brand__identity {
        text-align: center;
    }

    .login-brand__title {
        font-size: clamp(1.1rem, 4.5vw, 1.45rem);
        letter-spacing: 0.03em;
    }

    .login-brand__subtitle {
        font-size: 0.88rem;
    }

    .login-brand__pitch,
    .login-brand__features {
        display: none;
    }

    .login-brand__content {
        padding: 36px 24px 56px;
        text-align: center;
        align-items: center;
    }

    .login-form-panel {
        grid-column: auto;
        grid-row: auto;
        flex: 1;
        padding: 8px 24px 24px;
        margin-top: -20px;
        position: relative;
        z-index: 3;
        align-items: flex-start;
        background: #fff;
    }

    .login-form-wrap {
        max-width: none;
    }

    .login-mobile-features {
        display: flex;
        justify-content: space-around;
        gap: 8px;
        margin-top: 28px;
        padding: 20px 12px;
        background: #f9fafb;
        border-radius: 12px;
    }

    .login-mobile-features .login-brand__feature {
        align-items: center;
        text-align: center;
        font-size: 0.72rem;
        color: var(--login-primary);
        font-weight: 500;
    }

    .login-mobile-features .login-brand__feature i {
        color: var(--login-primary);
        font-size: 1.25rem;
        margin-bottom: 4px;
    }

    .login-page-footer {
        padding: 0 16px 20px;
        margin-top: auto;
        background: #fff;
    }
}

@media (min-width: 901px) and (max-width: 1080px) {
    .login-brand__content {
        padding: 32px 28px 28px;
    }

    .login-form-panel {
        padding: 40px 32px;
    }

    .login-brand__description {
        max-width: 300px;
    }
}

@media (min-width: 901px) {
    .login-mobile-features {
        display: none !important;
    }
}
