/* ==========================================
   Animated Auth Page (Sliding Panels)
========================================== */

html,
body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
    background: #fff !important;
}

.auth-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    overflow: hidden;
}

.forms-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.auth-brand {
    position: absolute;
    top: 30px;
    font-size: 26px;
    font-weight: 800;
    text-decoration: none;
    z-index: 100;
    /* Strictly on top */
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.9s 0.6s ease-in-out;
}

.auth-brand i {
    color: #fff;
}

.top-left-brand {
    left: 40px;
    color: #fff !important;
    background: none !important;
    -webkit-text-fill-color: #fff !important;
    z-index: 100;
}

.top-left-brand i {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

.top-right-brand {
    right: 40px;
    color: #fff !important;
    opacity: 0;
    pointer-events: none;
    z-index: 100;
}

.top-right-brand i {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

/* When in Sign-Up Mode */
.auth-container.sign-up-mode .top-left-brand {
    opacity: 0;
    pointer-events: none;
}

.auth-container.sign-up-mode .top-right-brand {
    opacity: 1;
    pointer-events: all;
    color: #fff !important;
    background: none !important;
    -webkit-text-fill-color: #fff !important;
}

.auth-container.sign-up-mode .top-right-brand i {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

.signin-signup {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    left: 75%;
    width: 50%;
    transition: 1s 0.7s ease-in-out;
    display: grid;
    grid-template-columns: 1fr;
    z-index: 5;
}

form {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 5rem;
    overflow: hidden;
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    transition: all 0.2s 0.7s;
}

form.sign-in-form {
    z-index: 2;
}

form.sign-up-form {
    opacity: 0;
    z-index: 1;
}

.title {
    font-size: 2.2rem;
    color: #444;
    margin-bottom: 10px;
}

.input-field {
    max-width: 380px;
    width: 100%;
    background-color: #f0f0f0;
    margin: 10px 0;
    height: 55px;
    border-radius: 50px;
    display: grid;
    grid-template-columns: 15% 85%;
    padding: 0 0.4rem;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.input-field:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 75, 31, 0.15);
    background-color: #fff8f6;
    /* Light tint of primary color */
}

.input-field:focus-within {
    box-shadow: 0 4px 15px rgba(255, 75, 31, 0.25);
    border: 1px solid #ff4b1f;
    background-color: #fff;
    /* Pure white on focus for clarity */
}

.input-field i {
    text-align: center;
    line-height: 55px;
    color: #acacac;
    transition: 0.5s;
    font-size: 1.1rem;
}

.input-field:focus-within i {
    color: #ff4b1f;
}

.input-field input {
    background: none;
    outline: none;
    border: none;
    line-height: 1;
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
}

/* Fix Chrome Autofill Background */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    transition: background-color 5000s ease-in-out 0s;
    -webkit-text-fill-color: #333 !important;
}

.input-field input::placeholder {
    color: #aaa;
    font-weight: 500;
}

/* ==========================================
   Panels (Overlay)
========================================== */

.panels-container {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

.panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center horizontally */
    justify-content: center;
    /* Center vertically */
    text-align: center;
    z-index: 6;
    padding: 0 10%;
    /* Standard side padding */
}

.left-panel {
    pointer-events: all;
}

.right-panel {
    pointer-events: none;
}

.content {
    color: #fff !important;
    /* Force white for all content in panels */
    transition: transform 0.9s ease-in-out;
    transition-delay: 0.6s;
    z-index: 7;
}

.panel h3 {
    font-weight: 800;
    /* Extra bold */
    line-height: 1;
    font-size: 2.5rem;
    /* Slightly larger */
    color: #fff;
    /* Explicitly white */
}

.panel p {
    font-weight: 600;
    /* Bolder text */
    font-size: 1.1rem;
    /* Slightly larger */
    padding: 0.7rem 0;
    color: #fff;
    /* Explicitly white */
}

.btn.transparent {
    margin: 0;
    background: none;
    border: 2px solid #fff;
    width: 180px;
    /* Wider */
    height: 50px;
    /* Taller */
    font-weight: 700;
    font-size: 1rem;
    /* Larger font */
    border-radius: 50px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn.transparent:hover {
    background-color: #fff;
    color: #ffaf7b;
    /* New light orange color */
}

.forgot-pass {
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 5px;
    align-self: center;
    transition: color 0.3s ease;
}

.forgot-pass:hover {
    color: #ff4b1f;
}

.image {
    width: 100%;
    transition: transform 1.1s ease-in-out;
    transition-delay: 0.4s;
    animation: floating 3.5s ease-in-out infinite;
    opacity: 0.9;
    /* Slight blend with background */
}

@keyframes floating {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-15px) rotate(2deg);
    }

    100% {
        transform: translateY(0) rotate(0deg);
    }
}

.right-panel .image,
.right-panel .content {
    transform: translateX(800px);
}

/* ==========================================
   Animation Logic
========================================== */

.auth-container.sign-up-mode:before {
    transform: translate(100%, -50%);
    right: 52%;
}

.auth-container.sign-up-mode .left-panel .image,
.auth-container.sign-up-mode .left-panel .content {
    transform: translateX(-800px);
}

.auth-container.sign-up-mode .signin-signup {
    left: 25%;
}

.auth-container.sign-up-mode form.sign-up-form {
    opacity: 1;
    z-index: 2;
}

.auth-container.sign-up-mode form.sign-in-form {
    opacity: 0;
    z-index: 1;
}

.auth-container.sign-up-mode .right-panel .image,
.auth-container.sign-up-mode .right-panel .content {
    transform: translateX(0%);
}

.left-panel {
    pointer-events: all;
}

.right-panel {
    pointer-events: none;
}

.auth-container.sign-up-mode .left-panel {
    pointer-events: none;
}

.auth-container.sign-up-mode .right-panel {
    pointer-events: all;
}

/* Background Blob */
.auth-container:before {
    content: "";
    position: absolute;
    height: 2000px;
    width: 2000px;
    top: -10%;
    right: 48%;
    transform: translateY(-50%);
    /* Dual Pet Reveal (Left and Right) */
    background-image:
        url('../img/pets_group.png'),
        url('../img/pets_right.png'),
        var(--primary-gradient);
    background-repeat: no-repeat;
    background-position:
        left 5% bottom 20%,
        right 10% bottom 20%,
        center;
    background-size:
        700px auto,
        600px auto,
        cover;
    background-attachment:
        fixed,
        fixed,
        scroll;
    background-blend-mode: multiply;
    transition: 1.8s ease-in-out;
    border-radius: 50%;
    z-index: 6;
    /* Stays behind .content (z: 7) */
}

@media (max-width: 870px) {
    .auth-container {
        min-height: 100vh;
        height: 100vh;
        overflow: hidden !important;
        /* Strictly no scroll */
    }

    .auth-brand {
        font-size: 1.1rem;
        top: 20px;
        left: 20px !important;
        z-index: 200;
    }

    .top-right-brand {
        right: auto !important;
        left: 20px !important;
    }

    .signin-signup {
        width: 100%;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        left: 50% !important;
        /* Force center on mobile */
        z-index: 100;
    }

    .auth-container.sign-up-mode .signin-signup {
        top: 50% !important;
        left: 50% !important;
        /* Force center in Sign-Up mode too */
        transform: translate(-50%, -50%) !important;
    }

    form {
        padding: 0 2rem !important;
        /* Reduce padding to ensure elements fit and center */
        align-items: center !important;
    }

    .panels-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 2fr 1fr;
        z-index: 10;
        height: 100%;
    }

    .panel {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 0 8% !important;
        grid-column: 1 / 2;
        z-index: 20;
    }

    .right-panel {
        grid-row: 3 / 4;
    }

    .left-panel {
        grid-row: 1 / 2;
    }

    .image {
        display: none !important;
    }

    .panel .content {
        padding: 0 !important;
        transition: transform 0.9s ease-in-out;
        transition-delay: 0.8s;
        text-align: center;
        z-index: 30;
    }

    .panel h3 {
        font-size: 1.3rem;
        margin-bottom: 5px;
    }

    .panel p {
        font-size: 0.7rem;
        padding: 0.5rem 0;
    }

    .btn.transparent {
        width: 160px;
        height: 45px;
        font-size: 1rem;
        font-weight: 800;
        background: rgba(255, 255, 255, 0.2);
        border: 2px solid #fff;
        margin-top: 10px;
    }

    /* MASSIVE BLOB POSITIONING TO COVER BUTTONS */
    /* BLOBS: REFINED TO ONLY COVER TEXT PANELS AS IN DESKTOP */
    .auth-container:before {
        width: 1500px;
        height: 1500px;
        left: 50%;
        top: -1150px;
        /* Covers exactly the TOP toggle panel in Sign-In mode */
        transform: translateX(-50%);
        bottom: auto;
        right: auto;
        transition: 1.8s ease-in-out;
        z-index: 5;
        background: var(--primary-gradient) !important;
        /* STRICTLY NO PET IMAGES ON MOBILE */
    }

    /* Catch-all to remove any remaining images */
    .auth-container img,
    .image {
        display: none !important;
    }

    .auth-container.sign-up-mode:before {
        top: 450px;
        /* Slides down to cover exactly the BOTTOM toggle panel in Sign-Up mode */
        transform: translateX(-50%);
    }

    .auth-container.sign-up-mode .left-panel .content {
        transform: translateY(-300px);
    }

    .auth-container.sign-up-mode .right-panel .content {
        transform: translateY(0px);
    }

    .right-panel .content {
        transform: translateY(250px);
        /* Move Sign In button higher while keeping it visible */
    }
}

@media (max-width: 570px) {
    form {
        padding: 0 1.5rem;
    }

    .panel .content {
        padding: 0.5rem 1rem;
    }

    .auth-container {
        padding: 1.5rem;
    }

    .auth-container:before {
        bottom: 85%;
        left: 50%;
    }

    .auth-container.sign-up-mode:before {
        bottom: 15%;
        left: 50%;
    }
}