* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 100%;
    max-width: 450px;
    padding: 40px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.container.loaded {
    opacity: 1;
    transform: translateY(0);
}

h1 {
    font-size: 2.5em;
    font-weight: bold;
    color: #333;
    margin-bottom: 30px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.form-toggle {
    display: flex;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 5px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.form-toggle button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.form-toggle button.active {
    color: white;
}

.form-toggle::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    width: calc(50% - 5px);
    height: calc(100% - 10px);
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: transform 0.3s ease;
    z-index: 1;
}

.form-toggle.cadastro-active::before {
    transform: translateX(100%);
}

.form {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.4s ease;
    max-height: 600px;
    overflow: hidden;
}

.form.hidden {
    opacity: 0;
    transform: translateX(20px);
    max-height: 0;
    padding: 0;
    margin: 0;
}

.form h2 {
    font-size: 1.8em;
    color: #333;
    margin-bottom: 25px;
}

.input-container {
    position: relative;
    margin-bottom: 20px;
}

.form input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form input.with-toggle {
    padding-right: 55px;
}

.form input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 18px;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.password-toggle:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

.form button[type="submit"] {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.form button[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.form button[type="submit"]:active {
    transform: translateY(-1px);
}

.message {
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 8px;
    text-align: center;
    display: none;
    animation: slideIn 0.3s ease;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsividade */
@media (max-width: 480px) {
    .container {
        margin: 10px;
        padding: 30px 25px;
    }

    h1 {
        font-size: 2em;
    }

    .form h2 {
        font-size: 1.5em;
    }

    .form input {
        padding: 12px 15px;
        font-size: 15px;
    }

    .form input.with-toggle {
        padding-right: 50px;
    }

    .form-toggle button {
        padding: 10px 15px;
        font-size: 15px;
    }

    .password-toggle {
        right: 12px;
        font-size: 16px;
    }
}

/* Efeitos de hover nos inputs */
.form input::placeholder {
    color: #999;
    transition: color 0.3s ease;
}

.form input:focus::placeholder {
    color: #ccc;
}

/* Animação de loading no botão */
.form button[type="submit"].loading {
    position: relative;
    color: transparent;
}

.form button[type="submit"].loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Validação visual das senhas */
.input-container.password-match input {
    border-color: #28a745;
}

.input-container.password-mismatch input {
    border-color: #dc3545;
}

.password-strength {
    font-size: 12px;
    margin-top: 5px;
    text-align: left;
    padding-left: 5px;
}

.password-strength.weak {
    color: #dc3545;
}

.password-strength.medium {
    color: #ffc107;
}

.password-strength.strong {
    color: #28a745;
}