@import url('https://fonts.googleapis.com/css?family=Montserrat:400,800');

* {
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.overlay-backdrop {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(3px);
    padding: 8px;
    border-radius: 8px;
}

.logo-small {
    width: 225px;
    margin-bottom: 5px;
}

.container {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25),
                0 10px 10px rgba(0, 0, 0, 0.22);
    position: relative;
    overflow: hidden;
    width: 850px;
    max-width: 100%;
    min-height: 480px;
    transition: all .6s ease-in-out;
}

.form-container {
    position: absolute;
    top: 0;
    height: 100%;
    transition: all .6s ease-in-out;
}

.sign-in-container {
    left: 0;
    width: 50%;
    z-index: 2;
}

.sign-up-container {
    left: 0;
    width: 50%;
    opacity: 0;
    z-index: 1;
    position: absolute;
}

.container.right-panel-active .sign-in-container {
    transform: translateX(100%);
}

.container.right-panel-active .sign-up-container {
    transform: translateX(100%);
    opacity: 1;
    z-index: 5;
    animation: show .6s;
}

@keyframes show {
    0%, 49.99% {
        opacity: 0;
        z-index: 1;
    }
    50%, 100% {
        opacity: 1;
        z-index: 5;
    }
}

form {
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 50px;
    height: 100%;
    text-align: center;
}

input,
textarea {
    background-color: #eee;
    border: none;
    padding: 12px 15px;
    margin: 8px 0;
    width: 100%;
    border-radius: 6px;
    resize: none;
}

button {
    border-radius: 20px;
    border: 1px solid #c62828;
    background-color: #c62828;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    padding: 12px 45px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: transform 80ms ease-in;
}

button:active {
    transform: scale(0.95);
}

button:focus {
    outline: none;
}

button.ghost {
    background-color: transparent;
    border-color: #fff;
}

.overlay-container {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition: transform .6s ease-in-out;
    z-index: 100;
}

.container.right-panel-active .overlay-container {
    transform: translateX(-100%);
}

.overlay {
    background: linear-gradient(to right, #d32f2f, #ff5252);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 0 0;
    color: #fff;
    position: relative;
    left: -100%;
    height: 100%;
    width: 200%;
    transform: translateX(0);
    transition: transform .6s ease-in-out;
}

.container.right-panel-active .overlay {
    transform: translateX(50%);
}

.overlay-panel {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 40px;
    text-align: center;
    top: 0;
    height: 100%;
    width: 50%;
    transform: translateX(0);
    transition: transform .6s ease-in-out;
}

.overlay-left {
    transform: translateX(-20%);
}

.container.right-panel-active .overlay-left {
    transform: translateX(0);
}

.overlay-right {
    right: 0;
}

.container.right-panel-active .overlay-right {
    transform: translateX(20%);
}

a {
    color: #c62828;
    font-size: 13px;
    text-decoration: none;
    margin: 8px 0;
}

.error {
    background: #ffcdd2;
    color: #b71c1c;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 13px;
}

/* Bigger gap between password and Sign In button */
input.pw-field {
    margin-bottom: 32px;
}

/* Full overlay "Thank You" panel */
.contact-success {
    position: absolute;
    inset: 0;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 40px;
    z-index: 10;
}

.contact-success h1 {
    margin: 10px 0;
    color: #d32f2f;
    font-size: 28px;
    font-weight: 800;
}

.contact-success p {
    font-size: 14px;
    color: #555;
    margin-top: 0;
}

/* === PASSWORD FIELD WITH SVG EYE ICON === */

.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    width: 100%;
    padding-right: 40px; /* space for the icon */
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 35%;
    transform: translateY(-50%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

.toggle-password svg {
    pointer-events: none; /* click handled by parent span */
}

/* MOBILE TOGGLE TEXT (hidden on desktop) */
.mobile-toggle-text {
    display: none;
}

/* ==========================================
   MOBILE: layout + vertical slide + thin slider
   ========================================== */
@media (max-width: 768px) {

    /* Layout: column, footer at bottom */
    body {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        margin: 0;
        background-attachment: scroll; /* fix mobile background */
    }

    /* Center the card on the screen */
    .container {
        width: 100%;
        max-width: 360px;
        height: 500px;
        margin: auto auto 0 auto; /* vertically center, leave space for footer */
        border-radius: 14px;
        overflow: hidden;
        position: relative;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
    }

    /* Forms slide left/right */
    .form-container {
        position: absolute;
        top: 0;
        width: 100%;
        height: 100%;
        transition: transform 0.4s ease, opacity 0.3s ease;
    }

    .sign-in-container {
        transform: translateX(0);
        opacity: 1;
        z-index: 2;
        background: #fff;
    }

    .sign-up-container {
        transform: translateX(100%);
        opacity: 0;
        z-index: 1;
        background: #fff;
    }

    /* When Contact is open */
    .container.mobile-contact-open .sign-in-container {
        transform: translateX(-100%);
        opacity: 0;
    }

    .container.mobile-contact-open .sign-up-container {
        transform: translateX(0);
        opacity: 1;
    }

    /* Hide overlay completely on mobile (no thin red line) */
    .overlay-container {
        display: none;
    }

    /* Form padding */
    form {
        padding: 30px 24px;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .logo-small {
        width: 180px;
        max-width: 70%;
        margin-bottom: 10px;
    }

    input,
    textarea {
        font-size: 14px;
    }

    button {
        width: 100%;
        padding: 12px;
        font-size: 13px;
    }

    /* Wording + link under forms */
    .mobile-toggle-text {
        display: block;
        margin-top: 14px;
        text-align: center;
        font-size: 14px;
        color: #555;
    }

    .mobile-toggle-btn {
        background: none;
        border: none;
        padding: 0;
        margin-left: 4px;
        color: #c62828;
        font-weight: 600;
        cursor: pointer;
        font-size: 14px;
    }

    .mobile-toggle-btn:focus {
        outline: none;
    }

    /* Footer at bottom of page, not fixed & not next to form */
    footer {
        position: static !important;
        margin-top: auto;
        width: 100%;
        text-align: center;
        font-size: 11px !important;
        padding: 10px 16px !important;
        background: rgba(15, 23, 42, 0.85) !important;
        box-sizing: border-box;
    }
}
