/* =========================
   GLOBAL STYLES
========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* =========================
   FLIP CARD CONTAINER
========================= */
.main-container {
    perspective: 1000px;
    width: 100%;
    max-width: 400px;
}

#flip-toggle {
    display: none;
}

.flip-card {
    width: 100%;
    height: 480px;
    position: relative;
}

.flip-card-inner {
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
    position: relative;
}

/* =========================
   DESKTOP FLIP
========================= */
@media (min-width: 768px) {
    #flip-toggle:checked ~ .flip-card .flip-card-inner {
        transform: rotateY(180deg) scale(1.02);
        box-shadow: 0 20px 30px rgba(0,0,0,0.2);
    }

    .flip-card-inner:hover {
        transform: rotateY(0deg) scale(1.01);
        transition: transform 0.6s ease-out;
    }

    .flip-front,
    .flip-back {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: #fff;
        border-radius: 20px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 25px 20px;
        backface-visibility: hidden;
        transition: transform 0.8s cubic-bezier(0.4, 0.2, 0.2, 1);
    }

    .flip-back {
        transform: rotateY(180deg);
    }
}

/* =========================
   MOBILE (stacked, toggle login/signup)
========================= */
@media (max-width: 767px) {
    .flip-card {
        height: auto;
    }

    .flip-card-inner {
        transform: none !important;
        transform-style: flat !important;
        display: block;
        height: auto;
    }

    .flip-front,
    .flip-back {
        position: relative;
        width: 100%;
        height: auto;
        display: none;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 25px 20px;
        border-radius: 20px;
        background: #fff;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        backface-visibility: visible;
    }

    .flip-front.active,
    .flip-back.active {
        display: flex;
    }
}

/* =========================
   HEADINGS & INPUTS
========================= */
h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 28px;
    text-align: center;
}

.input-group {
    width: 100%;
    margin-bottom: 20px;
}

input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
}

input:focus {
    border-color: #667eea;
}

.btn {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
    transition: background 0.3s;
}

.btn:hover {
    background: #764ba2;
}

.switch-text {
    margin-top: 25px;
    color: #666;
    font-size: 14px;
    text-align: center;
}

.switch-text label {
    font-weight: bold;
    color: #667eea;
    cursor: pointer;
    text-decoration: underline;
}

/* =========================
   MOBILE FONT & PADDING
========================= */
/* MOBILE ANIMATION FOR LOGIN/SIGNUP */
@media (max-width: 767px) {
    .flip-front,
    .flip-back {
        position: relative;
        width: 100%;
        height: auto;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: all 0.5s ease-in-out;
        background: #fff;
        border-radius: 20px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        padding: 0 25px; /* no height yet */
    }

    .flip-front.active,
    .flip-back.active {
        max-height: 1000px; /* large enough for content */
        opacity: 1;
        padding: 25px 20px;
    }
}


@media (max-width: 400px) {
    h2 {
        font-size: 20px;
    }

    input {
        padding: 12px;
    }

    .btn {
        padding: 12px;
    }

    .flip-front,
    .flip-back {
        padding: 20px 15px;
    }
}
