/* =========================================================
   KNOWURLOCAL — PUBLIC AUTHENTICATION
   ========================================================= */


/* =========================================================
   1. DESIGN TOKENS
   ========================================================= */

:root {

    --color-primary: #5272c9;

    --color-primary-dark: #435fa8;

    --color-primary-soft: #e8edfb;

    --color-accent: #8274c4;

    --color-text: #1a1e28;

    --color-text-secondary: #555d6c;

    --color-text-muted: #757d8c;

    --color-border: rgba(30, 38, 55, 0.10);

    --color-border-soft: rgba(30, 38, 55, 0.065);

    --color-surface: #ffffff;

    --color-surface-soft: #f7f9fc;

    --color-page: #f6f7fa;

    --color-danger: #c84d61;


    --auth-width: 980px;

    --auth-height: 620px;

    --panel-width: 52%;


    --radius-container: 24px;

    --radius-input: 10px;

    --radius-button: 10px;


    --transition-fast: 160ms ease;

    --transition-normal: 280ms ease;

    --transition-panel:
        650ms cubic-bezier(
            0.22,
            1,
            0.36,
            1
        );
}


/* =========================================================
   2. RESET
   ========================================================= */

* {

    margin: 0;

    padding: 0;

    box-sizing: border-box;

}


html {

    min-height: 100%;

    /*
     * Authentication decorations intentionally extend beyond some
     * component edges. They must never become page-level horizontal
     * overflow on mobile.
     */
    overflow-x: clip;

}


body {

    min-height: 100vh;

    width: 100%;
    max-width: 100%;
    overflow-x: clip;

    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: var(--color-text);

    background:
        radial-gradient(
            circle at 10% 10%,
            rgba(
                82,
                114,
                201,
                0.07
            ),
            transparent 32%
        ),
        var(--color-page);

    display: flex;

    justify-content: center;

    align-items: center;

    padding: 24px;

    -webkit-font-smoothing: antialiased;

    text-rendering: optimizeLegibility;

}


/* =========================================================
   3. ACCESSIBILITY HELPERS
   ========================================================= */

/*
 * Labels remain available to screen readers while being
 * visually hidden from the normal interface.
 */
.sr-only {

    position: absolute;

    width: 1px;

    height: 1px;

    padding: 0;

    margin: -1px;

    overflow: hidden;

    clip: rect(
        0,
        0,
        0,
        0
    );

    white-space: nowrap;

    border: 0;

}


/* =========================================================
   4. AUTH CONTAINER
   ========================================================= */

.container {

    position: relative;

    width: min(
        var(--auth-width),
        100%
    );

    height: var(--auth-height);

    background: var(--color-surface);

    border: 1px solid rgba(
        223,
        229,
        238,
        0.9
    );

    border-radius: var(--radius-container);

    overflow: hidden;

    box-shadow:
        0 24px 70px rgba(
            23,
            32,
            51,
            0.10
        ),
        0 4px 16px rgba(
            23,
            32,
            51,
            0.04
        );

}


/* =========================================================
   5. FORM SIDES
   ========================================================= */

.form-side {

    position: absolute;

    /*
     * Decorative pseudo-elements intentionally sit outside the form
     * bounds. Clip them at the form side so they cannot enlarge the
     * mobile document width.
     */
    overflow-x: clip;

    top: 0;

    width: 50%;

    height: 100%;

    padding:
        48px
        64px;

    display: flex;

    align-items: center;

    justify-content: center;

    background: var(--color-surface);

    transition:
        opacity var(--transition-normal),
        transform var(--transition-normal);

}


.login-side {

    right: 0;

    z-index: 5;

}


.register-side {

    left: 0;

    opacity: 0;

    pointer-events: none;

    z-index: 1;

}


.container.is-register .login-side {

    opacity: 0;

    pointer-events: none;

    transform: translateX(12px);

}


.container.is-register .register-side {

    opacity: 1;

    pointer-events: auto;

    z-index: 5;

    transform: translateX(0);

}


/* =========================================================
   5.5 FORM-SIDE DETAILS
   ========================================================= */

.form-side::before {

    content: "";

    position: absolute;
    width: 180px;
    height: 180px;
    top: -90px;
    right: -70px;

    border-radius: 50%;

    background: radial-gradient(
        circle,
        rgba(82,114,201,0.08) 0%,
        rgba(82,114,201,0) 70%
    );

    pointer-events: none;
}

.form-side::after {

    content: "";

    position: absolute;
    right: 28px;
    bottom: 28px;
    width: 54px;
    height: 54px;

    border: 1px solid rgba(82,114,201,0.09);
    border-radius: 14px;

    transform: rotate(12deg);

    pointer-events: none;
}

/* =========================================================
   6. FORM
   ========================================================= */

.form {

    width: 100%;

    max-width: 350px;

    min-width: 0;

}


.form-heading {

    margin-bottom: 28px;

}


.form-eyebrow {

    display: block;

    margin-bottom: 7px;

    color: var(--color-primary);

    font-size: 0.66rem;

    font-weight: 700;

    letter-spacing: 0.11em;

}


.form h2 {

    margin-bottom: 7px;

    color: var(--color-text);

    font-size: 1.65rem;

    line-height: 1.2;

    font-weight: 700;

    letter-spacing: -0.025em;

}


.subtitle {

    color: var(--color-text-secondary);

    font-size: 0.82rem;

    line-height: 1.5;

}


/* =========================================================
   7. NAME ROW
   ========================================================= */

/*
 * Keep the two registration name fields inside the form width.
 * Using two 50% flex items plus a gap makes the row wider than
 * its parent (50% + 50% + 10px), which can create horizontal
 * scrolling on narrower registration layouts.
 */
.row {

    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 10px;

    width: 100%;

    min-width: 0;

}


.input-group.half {

    width: auto;

    min-width: 0;

}


/* =========================================================
   8. INPUT GROUP
   ========================================================= */

.input-group {

    position: relative;

    margin-bottom: 14px;

}


.input-group > i {

    position: absolute;

    left: 14px;

    top: 50%;

    z-index: 2;

    transform: translateY(-50%);

    color: var(--color-text-muted);

    font-size: 17px;

    line-height: 1;

    pointer-events: none;

    transition:
        color var(--transition-fast);

}


.input-group input {

    width: 100%;

    height: 46px;

    padding:
        0
        44px;

    border: 1px solid var(--color-border);

    border-radius: var(--radius-input);

    outline: none;

    background: #f0f2f6;

    color: var(--color-text);

    font-family: inherit;

    font-size: 0.86rem;

    transition:
        background-color var(--transition-fast),
        border-color var(--transition-fast),
        box-shadow var(--transition-fast);

}


.input-group input::placeholder {

    color: #9aa5b5;

}


.input-group input:hover {

    border-color: #cbd4e1;

}


.input-group input:focus {

    border-color: var(--color-primary);

    background: var(--color-surface);

    box-shadow:
        0 0 0 3px rgba(
            49,
            95,
            189,
            0.10
        );

}


.input-group:focus-within > i {

    color: var(--color-primary);

}


/* =========================================================
   9. PASSWORD TOGGLE
   ========================================================= */

.toggle-password {

    position: absolute;

    right: 10px;

    top: 50%;

    width: 30px;

    height: 30px;

    transform: translateY(-50%);

    display: flex;

    align-items: center;

    justify-content: center;

    border: 0;

    border-radius: 7px;

    background: transparent;

    color: var(--color-text-muted);

    cursor: pointer;

    transition:
        color var(--transition-fast),
        background-color var(--transition-fast);

}


.toggle-password:hover {

    color: var(--color-primary);

    background:
        var(--color-primary-soft);

}


.toggle-password:focus-visible {

    outline: 2px solid #91afe8;

    outline-offset: 1px;

}


.toggle-password i {

    font-size: 16px;

}


/* =========================================================
   10. FORGOT PASSWORD
   ========================================================= */

.forgot-password-wrapper {

    display: flex;

    justify-content: flex-end;

    margin-top: -4px;

    margin-bottom: 18px;

}


.forgot-password-link {

    color: var(--color-primary);

    font-size: 0.74rem;

    font-weight: 600;

    text-decoration: none;

    transition:
        color var(--transition-fast),
        opacity var(--transition-fast);

}


.forgot-password-link:hover {

    color: var(--color-primary-dark);

    text-decoration: underline;

}


.forgot-password-link:focus-visible {

    outline: 2px solid #91afe8;

    outline-offset: 3px;

    border-radius: 2px;

}


/* =========================================================
   10. TERMS
   ========================================================= */

.checkbox-group {

    display: flex;

    align-items: flex-start;

    gap: 9px;

    margin:
        7px
        0
        20px;

    color: var(--color-text-secondary);

    font-size: 0.75rem;

    line-height: 1.5;

    cursor: pointer;

}


.checkbox-group input {

    width: 15px;

    height: 15px;

    margin-top: 2px;

    flex-shrink: 0;

    accent-color:
        var(--color-primary);

    cursor: pointer;

}


.checkbox-group a {

    color: var(--color-primary);

    font-weight: 600;

    text-decoration: none;

}


.checkbox-group a:hover {

    text-decoration: underline;

}


.checkbox-group a:focus-visible {

    outline: 2px solid #91afe8;

    outline-offset: 2px;

}


/* =========================================================
   11. PRIMARY BUTTON
   ========================================================= */

.btn {

    width: 100%;

    height: 46px;

    border: 1px solid transparent;

    border-radius: var(--radius-button);

    background:
        linear-gradient(
            135deg,
            var(--color-primary),
            #6a83d0
        );

    color: #ffffff;

    font-family: inherit;

    font-size: 0.84rem;

    font-weight: 600;

    cursor: pointer;

    box-shadow:
        0 5px 12px rgba(
            49,
            95,
            189,
            0.18
        );

    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        filter var(--transition-fast);

}


.btn:hover {

    filter: brightness(1.04);

    transform: translateY(-1px);

    box-shadow:
        0 8px 18px rgba(
            49,
            95,
            189,
            0.22
        );

}


.btn:active {

    transform: translateY(0);

    box-shadow:
        0 3px 8px rgba(
            49,
            95,
            189,
            0.16
        );

}


.btn:focus-visible {

    outline: 2px solid #91afe8;

    outline-offset: 3px;

}


/* =========================================================
   12. LOGIN / REGISTER SWITCH
   ========================================================= */

.switch {

    margin-top: 19px;

    text-align: center;

    color: var(--color-text-secondary);

    font-size: 0.76rem;

}


.switch-button {

    margin-left: 3px;

    padding: 0;

    border: 0;

    background: transparent;

    color: var(--color-primary);

    font-family: inherit;

    font-size: inherit;

    font-weight: 600;

    cursor: pointer;

}


.switch-button:hover {

    color: var(--color-primary-dark);

    text-decoration: underline;

}


.switch-button:focus-visible {

    outline: 2px solid #91afe8;

    outline-offset: 3px;

    border-radius: 2px;

}


/* =========================================================
   13. BRAND PANEL
   ========================================================= */

.overlay-panel {

    position: absolute;

    top: 0;

    left: 0;

    width: var(--panel-width);

    height: 100%;

    z-index: 10;

    display: flex;

    align-items: center;

    overflow: hidden;

    color: #ffffff;

    background: #1769E0;

    clip-path:
        ellipse(
            88%
            105%
            at
            0%
            50%
        );

    box-shadow:
        12px 0 40px rgba(
            23,
            32,
            51,
            0.10
        );

    transition:
        left var(--transition-panel),
        clip-path var(--transition-panel);

}


.container.is-register .overlay-panel {

    left:
        calc(
            100% - var(--panel-width)
        );

    clip-path:
        ellipse(
            88%
            105%
            at
            100%
            50%
        );

}


/* =========================================================
   14. PANEL ATMOSPHERE
   ========================================================= */

.overlay-panel::before {

    content: "";

    position: absolute;

    width: 430px;
    height: 430px;

    left: -170px;
    top: -120px;

    border: 1px solid rgba(255,255,255,0.13);
    border-radius: 50%;

    box-shadow:
        0 0 0 34px rgba(255,255,255,0.025),
        0 0 0 68px rgba(255,255,255,0.018);

    pointer-events: none;
}

.overlay-panel::after {

    content: "";

    position: absolute;

    right: -90px;
    bottom: -150px;

    width: 320px;
    height: 320px;

    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 50%;

    background: rgba(255,255,255,0.025);

    pointer-events: none;
}

/* The old raster-logo accessory was removed. The panel now uses
   restrained CSS-only geometry so it remains independent of image files. */

.panel-route-art {

    position: absolute;

    right: 48px;
    bottom: 58px;

    width: 150px;
    height: 84px;

    opacity: 0.22;

    pointer-events: none;
}

.panel-route-art::before {

    content: "";

    position: absolute;
    inset: 18px 4px 12px 8px;

    border: 1px solid rgba(255,255,255,0.55);
    border-left-color: transparent;
    border-bottom-color: transparent;
    border-radius: 46% 54% 42% 58%;

    transform: rotate(-15deg);
}

.panel-route-art::after {

    content: "";

    position: absolute;
    right: 4px;
    top: 10px;

    width: 8px;
    height: 8px;

    border: 2px solid rgba(255,255,255,0.9);
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    box-shadow:
        -78px 44px 0 -1px rgba(255,255,255,0.75),
        -120px 15px 0 -2px rgba(255,255,255,0.55);
}

/* =========================================================
   14. PANEL CONTENT
   ========================================================= */

.panel-content {

    position: absolute;

    width: 100%;

    height: 100%;

    padding:
        0
        72px;

    display: flex;

    flex-direction: column;

    justify-content: center;

    opacity: 0;

    pointer-events: none;

    transition:
        opacity 260ms ease;

}


.panel-content.active {

    opacity: 1;

    pointer-events: auto;

    transition-delay: 180ms;

}


.login-content {

    align-items: flex-start;

    text-align: left;

}


.register-content {

    align-items: flex-end;

    text-align: right;

}


/* =========================================================
   15. BRAND MARK
   ========================================================= */

.brand-mark {

    width: 38px;

    height: 38px;

    margin-bottom: 18px;

    display: flex;

    align-items: center;

    justify-content: center;

    border: 1px solid rgba(
        255,
        255,
        255,
        0.20
    );

    border-radius: 10px;

    background:
        rgba(
            255,
            255,
            255,
            0.10
        );

    color: #ffffff;

    font-size: 0.68rem;

    font-weight: 700;

    letter-spacing: 0.04em;

}


.panel-eyebrow {

    margin-bottom: 7px;

    color: rgba(
        255,
        255,
        255,
        0.70
    );

    font-size: 0.65rem;

    font-weight: 700;

    letter-spacing: 0.12em;

}


.panel-content h1 {

    max-width: 300px;

    margin-bottom: 12px;

    font-size: 1.9rem;

    line-height: 1.12;

    font-weight: 700;

    letter-spacing: -0.03em;

}


.panel-content h1 span {

    display: block;

    color: rgba(
        255,
        255,
        255,
        0.72
    );

}







.panel-content p {

    max-width: 285px;

    margin-bottom: 28px;

    color: rgba(
        255,
        255,
        255,
        0.76
    );

    font-size: 0.81rem;

    line-height: 1.65;

}


.auth-brand-icon {
    display: block;
    width: 30px;
    height: 30px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.auth-brand-fallback {
    display: none;
}

.auth-brand-logo-missing .auth-brand-fallback {
    display: inline;
}


/* =========================================================
   16. FEATURE LIST
   ========================================================= */

.features {

    display: flex;

    flex-direction: column;

    gap: 10px;

    list-style: none;

}


.features li {

    display: flex;

    align-items: center;

    gap: 10px;

    color: rgba(
        255,
        255,
        255,
        0.92
    );

    font-size: 0.78rem;

    font-weight: 500;

}


.register-content .features li {

    justify-content: flex-end;

}


.feature-icon {

    width: 30px;

    height: 30px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    border: 1px solid rgba(
        255,
        255,
        255,
        0.16
    );

    border-radius: 8px;

    background:
        rgba(
            255,
            255,
            255,
            0.08
        );

}


.feature-icon i {

    font-size: 16px;

    color: rgba(
        255,
        255,
        255,
        0.92
    );

}


/* =========================================================
   17. TABLET
   ========================================================= */

@media (max-width: 850px) {

    body {

        min-height: 100vh;

        align-items: flex-start;

        padding: 0;

    }


    .container {

        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 100vh;

        /*
         * Keep the animated/decorative layers inside the viewport.
         * Vertical content remains available because the container
         * grows with its form section.
         */

        height: auto;

        border: 0;

        border-radius: 0;

        box-shadow: none;

        overflow-x: clip;
        overflow-y: visible;

        display: flex;

        flex-direction: column;

    }


    .overlay-panel {

        position: relative;

        top: auto;

        left: auto !important;

        width: 100%;

        height: 215px;

        flex-shrink: 0;

        justify-content: center;

        clip-path:
            ellipse(
                125%
                100%
                at
                50%
                0%
            );

        box-shadow: none;

        transition: none;

    }


    .container.is-register .overlay-panel {

        left: auto !important;

        clip-path:
            ellipse(
                125%
                100%
                at
                50%
                0%
            );

    }


    .panel-content {

        position: absolute;

        height: 100%;

        padding:
            0
            24px;

        align-items: center !important;

        justify-content: center;

        text-align: center !important;

        transition: none;

    }


    .panel-content h1 {

        font-size: 1.55rem;

    }


    .panel-content p {

        margin-bottom: 20px;

        font-size: 0.76rem;

    }


    .features {

        flex-direction: row;

        gap: 8px;

    }


    .features li {

        flex-direction: column;

        gap: 5px;

        font-size: 0.67rem;

    }


    .register-content .features li {

        justify-content: center !important;

    }


    .form-side {

        position: relative;

        left: auto;

        right: auto;

        width: 100%;

        min-height:
            calc(
                100vh - 215px
            );

        height: auto;

        padding:
            36px
            24px
            48px;

        display: flex;

        opacity: 1;

        transform: none !important;

    }


    .login-side {

        display: flex;

        order: 1;

    }


    .register-side {

        display: none;

        order: 1;

    }


    .container.is-register .login-side {

        display: none;

    }


    .container.is-register .register-side {

        display: flex;

    }


    .form {

        width: 100%;
        max-width: 430px;
        min-width: 0;

    }

}


/* =========================================================
   18. MOBILE
   ========================================================= */

@media (max-width: 520px) {

    /*
     * Give the brand panel enough vertical space for:
     *
     * - KNOWURLOCAL label
     * - heading
     * - description
     * - three feature icons
     *
     * The previous 195px height was too small, causing
     * the feature icons to overlap the curved boundary.
     */
    .overlay-panel {

        /* Extra height keeps feature labels fully above the curved edge. */
        height: 260px;

    }


    /*
     * Keep the form height synchronized with the new
     * mobile header height.
     */
    .form-side {

        min-height:
            calc(
                100vh - 260px
            );

        padding:
            30px
            18px
            40px;

    }


    /*
     * Stack first and last name fields vertically on
     * narrow screens.
     */
    .row {

        grid-template-columns: minmax(0, 1fr);

        gap: 0;

    }


    /*
     * Each name field receives the full available width.
     */
    .input-group.half {

        width: 100%;

    }


    /*
     * Make the brand content more compact so the entire
     * introduction fits comfortably inside the panel.
     */
    .panel-content {

        /* Keep the complete brand introduction inside the curved panel. */
        padding:
            8px
            18px
            18px;

        justify-content: flex-start;

    }


    /*
     * The small KL mark is unnecessary on a very narrow
     * screen and consumes valuable vertical space.
     */
    .brand-mark {

        width: 32px;

        height: 32px;

        margin-bottom: 5px;

        border-radius: 8px;

        font-size: 0.58rem;

    }


    /*
     * Keep the KNOWURLOCAL label compact.
     */
    .panel-eyebrow {

        margin-bottom: 4px;

        font-size: 0.58rem;

    }


    /*
     * Reduce heading size slightly for small screens.
     */
    .panel-content h1 {

        max-width: 250px;

        margin-bottom: 5px;

        font-size: 1.35rem;

        line-height: 1.08;

    }


    /*
     * Shorter description spacing prevents the feature
     * row from being pushed too far downward.
     */
    .panel-content p {

        max-width: 270px;

        margin-bottom: 8px;

        font-size: 0.68rem;

        line-height: 1.45;

    }


    /*
     * Keep the three features horizontal.
     */
    .features {

        flex-direction: row;

        gap: 10px;

    }


    /*
     * Stack each icon above its label.
     */
    .features li {

        min-width: 62px;

        flex-direction: column;

        gap: 4px;

        font-size: 0.62rem;

    }


    /*
     * Make the feature icons slightly smaller while
     * retaining the lightweight SaaS appearance.
     */
    .feature-icon {

        width: 27px;

        height: 27px;

        border-radius: 7px;

    }


    .feature-icon i {

        font-size: 14px;

    }


    /*
     * Registration-side features remain centered on mobile.
     */
    .register-content .features li {

        justify-content: center !important;

    }


    /*
     * Slightly reduce the form heading size.
     */
    .form h2 {

        font-size: 1.4rem;

    }


    /*
     * Keep inputs comfortable for touch interaction.
     */
    .input-group input {

        height: 48px;

    }


    /*
     * Keep the primary action comfortable on mobile.
     */
    .btn {

        height: 48px;

    }

}


/* =========================================================
   19. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {

        scroll-behavior: auto !important;

        transition-duration:
            0.01ms !important;

        animation-duration:
            0.01ms !important;

        animation-iteration-count:
            1 !important;

    }

}
