@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

:root {
    --bg-main: #f4f7fa;
    --bg-white: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --primary-blue: #4f46e5;
    --primary-blue-dark: #4338ca;
    --gradient-start: #6a11cb;
    --gradient-end: #2575fc;
    --border-color: #e5e7eb;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --success-green: #16a34a;
    --error-red: #dc2626;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    background-color: var(--bg-main);
}

.login-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* --- LADO ESQUERDO (BRANDING) --- */
.branding-side {
    width: 45%;
    background-image: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    color: white;
}

.branding-text h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.branding-text p {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* --- LADO DIREITO (FORMULÁRIO) --- */
.form-side {
    width: 55%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.form-wrapper {
    width: 100%;
    max-width: 420px;
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 30px var(--shadow-color);
    overflow: hidden;
    position: relative;
    height: 500px; 
    transition: height 0.3s ease;
}

.form-wrapper.show-register {
    height: 560px; 
}


.form-box {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(100% - 5rem);
    transform: translateX(-50%) translateY(-50%); 
    transition: transform 0.4s ease-in-out;
}

.form-wrapper.show-register .login-form {
    transform: translateX(-750%) translateY(-50%); 
}

.register-form {
    transform: translateX(150%) translateY(-50%); 
}

.form-wrapper.show-register .register-form {
    transform: translateX(-50%) translateY(-50%); 
}

.form-box h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.input-box {
    position: relative;
    width: 100%;
    height: 50px;
    margin: 25px 0;
} 

.input-box input {
    width: 100%;
    height: 100%;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    outline: none;
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-primary);
    padding: 0 45px 0 20px;
    transition: border-color 0.2s;
}

.input-box input:focus {
    border-color: var(--primary-blue);
}

.input-box input::placeholder {
    color: var(--text-secondary);
}

.input-box i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.btn {
    width: 100%;
    height: 48px;
    background: var(--primary-blue);
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    color: #ffffff;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}
.btn:hover {
    background: var(--primary-blue-dark);
}

.form-box p {
    font-size: 0.9rem;
    text-align: center;
    margin-top: 2rem;
    color: var(--text-secondary);
}

.form-box p a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

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

/* --- SISTEMA DE ALERTA --- */
.alert-box {
  position: fixed;
  top: 20px;
  right: 20px;
  width: auto;
  max-width: 400px;
  background: var(--bg-white);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateX(calc(100% + 20px));
  transition: transform 0.5s ease-in-out;
  overflow: hidden;
}

.alert-box.show {
  transform: translateX(0);
}

.alert {
  display: flex;
  align-items: center;
  height: 100%;
  color: var(--text-primary);
  font-weight: 500;
}

.alert::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  animation: progress 5s linear forwards;
}

@keyframes progress {
  100% { width: 0; }
}

.alert.sucess::after { background: var(--success-green); }
.alert.sucess i { color: var(--success-green); }

.alert.error::after { background: var(--error-red); }
.alert.error i { color: var(--error-red); }

.alert i {
  font-size: 1.5rem;
  margin-right: 10px;
}

@media (max-width: 992px) {
    .login-container {
        flex-direction: column;
    }
    .branding-side, .form-side {
        width: 100%;
    }
    .branding-side {
        min-height: 250px;
        justify-content: center;
        text-align: center;
    }
    .form-side {
        padding: 2rem 1rem;
    }
}