﻿:root {
    --teal-dark: #1F92B3;
    --teal: #2CA9CB;
    --teal-light: #A9DDEC;
    --teal-pale: #CFEBF4;
    --navy: #1C2260;
    --slate: #8891A5;
    --paper: #F3F5F9;
    --white: #FFFFFF;
    --green: #45B587;
    --amber: #FFC24B;
    --purple: #4E4BD6;
    --radius: 14px;
    --ease: cubic-bezier(.4,0,.2,1);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: 'Cairo', -apple-system, sans-serif;
    background: var(--teal);
    color: var(--navy);
    -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

.stage {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    padding: 2.6rem 1.5rem;
}

.blob {
    position: absolute;
    border-radius: 50%;
    background: var(--teal-light);
    opacity: .55;
}

    .blob.tl {
        width: 260px;
        height: 260px;
        top: -110px;
        right: -90px;
    }

    .blob.tr {
        width: 340px;
        height: 340px;
        top: -150px;
        left: -140px;
    }

    .blob.bl {
        width: 220px;
        height: 220px;
        bottom: -110px;
        right: -80px;
    }

    .blob.br {
        width: 300px;
        height: 300px;
        bottom: -140px;
        left: -110px;
    }

.stage-head {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    margin-bottom: 2.2rem;
}

    .stage-head h1 {
        font-size: clamp(1.6rem, 3vw, 2.1rem);
        font-weight: 700;
        margin: 0 0 .35rem 0;
    }

    .stage-head p {
        margin: 0;
        font-weight: 400;
        font-size: 1rem;
        color: rgba(255,255,255,0.88);
    }

.card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1080px;
    background: var(--paper);
    border-radius: 18px;
    box-shadow: 0 40px 70px -30px rgba(10,30,50,0.35);
    padding: 2.6rem 3rem 2.2rem;
    display: flex;
    flex-direction: column;
}

.logo {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--navy);
    margin-bottom: 1.6rem;
}

.card-body {
    display: flex;
    align-items: center;
    gap: 3rem;
}

/* ===== ILLUSTRATION ===== */
.illus-wrap {
    flex: 1 1 50%;
    display: flex;
    justify-content: center;
}

    .illus-wrap svg {
        width: 100%;
        max-width: 420px;
        height: auto;
    }

.float {
    animation: floaty 4.5s ease-in-out infinite;
}

.float-slow {
    animation: floaty 6s ease-in-out infinite;
}

.float-rev {
    animation: floatyRev 5s ease-in-out infinite;
}

@keyframes floaty {
    0%,100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes floatyRev {
    0%,100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(8px);
    }
}

/* ===== FORM ===== */
.form-wrap {
    flex: 1 1 50%;
    max-width: 420px;
}

    .form-wrap h2 {
        font-size: 1.6rem;
        font-weight: 700;
        margin: 0 0 .3rem 0;
    }

    .form-wrap > p {
        margin: 0 0 1.6rem 0;
        color: var(--slate);
        font-size: .95rem;
    }

.field {
    margin-bottom: 1.1rem;
}

.input-shell {
    position: relative;
    display: flex;
    align-items: center;
}

    .input-shell .icon {
        position: absolute;
        right: .95rem;
        color: var(--teal);
        display: flex;
    }

    .input-shell input {
        width: 100%;
        font-family: inherit;
        font-size: .95rem;
        padding: .85rem 2.6rem .85rem 1rem;
        border: 1.5px solid var(--teal-light);
        border-radius: 8px;
        background: #fff;
        color: var(--navy);
        outline: none;
        text-align: right;
        transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
    }

        .input-shell input::placeholder {
            color: #A9B0C2;
        }

        .input-shell input:hover {
            border-color: var(--teal);
        }

        .input-shell input:focus {
            border-color: var(--teal-dark);
            box-shadow: 0 0 0 3px rgba(44,169,203,0.18);
        }

        .input-shell input.err {
            border-color: #E5645C;
        }

            .input-shell input.err:focus {
                box-shadow: 0 0 0 3px rgba(229,100,92,0.15);
            }

.toggle-pw {
    position: absolute;
    left: .85rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--slate);
    font-size: .76rem;
    font-weight: 600;
    padding: .3rem;
    font-family: inherit;
}

    .toggle-pw:hover {
        color: var(--teal-dark);
    }

    .toggle-pw:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible {
        outline: 2px solid var(--teal-dark);
        outline-offset: 2px;
    }

.err-msg {
    font-size: .78rem;
    color: #E5645C;
    min-height: 1em;
    display: none;
    margin-top: .35rem;
}

    .err-msg.show {
        display: block;
    }

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: .3rem 0 1.5rem 0;
    font-size: .88rem;
}

.remember {
    display: flex;
    align-items: center;
    gap: .55rem;
    color: var(--navy);
    cursor: pointer;
    user-select: none;
    font-weight: 500;
}

    .remember input {
        appearance: none;
        width: 17px;
        height: 17px;
        border: 1.5px solid var(--teal-light);
        border-radius: 5px;
        cursor: pointer;
        position: relative;
        flex-shrink: 0;
        background: #fff;
        transition: background .15s var(--ease), border-color .15s var(--ease);
    }

        .remember input:checked {
            background: var(--teal-dark);
            border-color: var(--teal-dark);
        }

            .remember input:checked::after {
                content: "";
                position: absolute;
                right: 5px;
                top: 1.5px;
                width: 4px;
                height: 8px;
                border: solid #fff;
                border-width: 0 1.6px 1.6px 0;
                transform: rotate(40deg);
            }

.row-between a {
    color: var(--purple);
    text-decoration: none;
    font-weight: 600;
}

    .row-between a:hover {
        text-decoration: underline;
    }

.btn-primary {
    width: 100%;
    padding: .85rem 1.4rem;
    background: var(--teal-dark);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: .98rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    transition: background .15s var(--ease), transform .1s var(--ease);
}

    .btn-primary:hover {
        background: #197C9B;
    }

    .btn-primary:active {
        transform: scale(0.99);
    }

    .btn-primary .spinner {
        width: 14px;
        height: 14px;
        border-radius: 50%;
        border: 2px solid rgba(255,255,255,0.4);
        border-top-color: #fff;
        display: none;
        animation: spin .7s linear infinite;
    }

    .btn-primary.loading .spinner {
        display: inline-block;
    }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.signup-link {
    text-align: center;
    margin-top: 1rem;
    font-size: .9rem;
}

    .signup-link a {
        color: var(--purple);
        font-weight: 600;
        text-decoration: none;
    }

        .signup-link a:hover {
            text-decoration: underline;
        }

/* ===== FOOTER ===== */
.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2.4rem;
    padding-top: 1.4rem;
    border-top: 1px solid #E3E7EF;
    font-size: .8rem;
    color: var(--slate);
    flex-wrap: wrap;
    gap: .8rem;
}

    .card-foot .links {
        display: flex;
        gap: .9rem;
    }

    .card-foot a {
        color: var(--slate);
        text-decoration: none;
    }

        .card-foot a:hover {
            color: var(--navy);
        }

    .card-foot .sep {
        color: #C7CCDA;
    }

.loader-spinner {
    width: 46px;
    height: 46px;
    border: 5px solid #CFEBF4;
    border-top-color: #1F92B3;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .card {
        padding: 2.2rem 2rem 1.8rem;
    }

    .card-body {
        gap: 2rem;
    }

    .illus-wrap svg {
        max-width: 320px;
    }
}

@media (max-width: 760px) {
    .card-body {
        flex-direction: column;
    }

    .illus-wrap {
        order: 1;
        margin-bottom: .5rem;
    }

    .form-wrap {
        order: 2;
        max-width: 100%;
        width: 100%;
    }

    .illus-wrap svg {
        max-width: 260px;
    }

    .stage-head {
        margin-bottom: 1.6rem;
    }
}

@media (max-width: 480px) {
    .stage {
        padding: 1.6rem 1rem;
    }

    .card {
        padding: 1.8rem 1.3rem 1.5rem;
        border-radius: 14px;
    }

    .card-foot {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-primary {
        width: 100%;
    }
}