* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body,
html {
    /* min-height 100% body par behtar kaam karta hai */
    min-height: 100%;
    font-family: 'Inter', sans-serif;
    /* Sticky footer ke liye Flex column */
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    /* Page ko thoda off-white background diya hai */
    background-color: #f8f9fa;
}

/* --- Main Content & Sticky Footer --- */
.main {
    /* Yeh 'main' area ko bachi hui poori height lene dega */
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center; /* Mobile par vertical center */
    /* Header ke liye top padding, mobile par side padding, footer se pehle bottom padding */
    padding: 60px 15px 40px 15px;
}

/* Desktop par, content ko upar align karein */
@media (min-width: 992px) {
    .main {
        align-items: flex-start;
        padding-top: 100px;
    }
}

/* --- Wrapper & Container --- */
.wrapper {
    width: 100%;
    max-width: 420px; /* Form ki max width */
}

.container {
    width: 100%;
    position: relative;
}

/* --- Responsive Form Switching (THE FIX) --- */

/* * Yahan main 'position: absolute' ko hata raha hoon.
 * Ab hum 'display: none' aur 'display: flex' ka istemaal karenge.
 * Isse container ki height content ke hisab se automatically adjust hogi.
 * Aapka JavaScript logic (class add/remove karna) same rahega.
*/

.container .form-box {
    /* Dono ko default mein hide karein */
    display: none;
    flex-direction: column;
    align-items: center;

    /* Original styles (bas 'position: absolute' aur 'min-height' hata diya) */
    width: 100%;
    padding: 30px 25px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
    color: #0b2540;
    /* Height ab automatic hai! */
}

/* Ab JS class ke adhaar par sahi box dikhayein */
.container.show-login .login-box {
    display: flex;
}

.container.show-signup .signup-box {
    display: flex;
}

/* Forgot/New Password forms 'login-box' ke andar hi hain, isliye unke liye 'login-box' dikhana zaroori hai */
.container.show-forgot .login-box,
.container.show-new-password .login-box {
    display: flex;
}

/* --- General Form Styling --- */

/* Verification Box (PHP se) */
.verify-box {
    width: 100%;
    text-align: center;
    padding: 30px 25px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
}

.message-box h1 {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
}

.message-box.success p {
    color: #155724;
}

.message-box.error p {
    color: #721c24;
}

.message-box a {
    color: #4285f4;
    text-decoration: none;
    font-weight: 500;
}

/* Toggle Buttons */
.switch-buttons {
    background: #f0f0f0;
    border-radius: 50px;
    display: flex;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.switch-buttons button {
    border: none;
    background: transparent;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

/* Chhote screens par button text fit karne ke liye */
@media (max-width: 360px) {
    .switch-buttons button {
        padding: 10px 18px;
        font-size: 13px;
    }
}

.switch-buttons .active {
    background: #4285f4;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(66, 133, 244, 0.4);
}

.form-box h2 {
    margin-bottom: 15px;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    color: #0b2540;
}

.form-box form {
    width: 100%; /* Form ko poori width dein */
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    border-radius: 10px; /* Thoda modern radius */
    border: 1px solid #ddd; /* Border se input field clear dikhta hai */
    outline: none;
    margin-bottom: 15px;
    font-size: 16px;
    caret-color: #4285f4;
    color: #333;
    background: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.15);
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px; /* Input se match karta hua */
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    background: #4285f4; /* Simple brand color */
    color: white;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
    transition: all 0.3s ease;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover {
    background: #3367d6; /* Thoda dark */
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(66, 133, 244, 0.4);
}

/* Google Button */
.btn[onclick="googleAuth()"] {
    background: #fff;
    color: #444;
    border: 1px solid #ddd;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-transform: none;
}

.btn[onclick="googleAuth()"]:hover {
    background: #f8f8f8;
    border-color: #ccc;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.08);
}

/* Links & Messages */
.forgot-password-link,
.back-to-login-link {
    display: block;
    text-align: right;
    font-size: 14px;
    color: #4285f4;
    text-decoration: none;
    margin-top: -10px;
    margin-bottom: 15px;
}

.back-to-login-link {
    text-align: center;
    margin-top: 10px;
}

.message {
    font-size: 14px;
    text-align: center;
    margin-top: 10px;
    min-height: 1.2em; /* Message aane par layout jump nahi hoga */
}

/* Terms & Conditions */
.terms-box {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
}

.terms-box input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    accent-color: #4285f4;
}

.terms-box a {
    color: #4285f4;
    text-decoration: none;
}

.terms-box a:hover {
    text-decoration: underline;
}