/* ui/static/src/css/login.css */

/* ============================================
   Importar Fontes
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

/* ============================================
   Variáveis da Plataforma WeGen AI
   ============================================ */
:root {
    /* Cores primárias */
    --color-primary: rgb(89, 47, 200);
    --color-primary-light: #c8bbff;
    --color-primary-dark: #6627b9;
    --color-secondary: rgba(163, 110, 255, 0.89);

    /* Cores de fundo */
    --color-background: #f6f5fa;
    --color-bg-white: #ffffff;

    /* Cores de texto */
    --color-text-primary: rgba(57, 56, 56, 0.89);
    --color-text-secondary: #8a8a9e;
    --color-text-muted: #8a8a9e;

    /* Cores de estado */
    --error-color: #ef4444;
    --success-color: #10b981;

    /* Bordas */
    --border-color: #e5e7eb;
    --border-radius: 14px;

    /* Sombras */
    --shadow-light: rgba(138, 63, 252, 0.2);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(138, 63, 252, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(138, 63, 252, 0.15);
    --shadow-xl: 0 20px 25px -5px rgba(138, 63, 252, 0.2);

    /* Gradiente principal */
    --primary-gradient: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

/* ============================================
   Reset
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   Container Principal
   ============================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    background: var(--primary-gradient);
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
}

/* ============================================
   Decoração de Fundo
   ============================================ */
.background-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.gradient-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(60px);
    animation: float 20s infinite ease-in-out;
}

.circle-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.circle-2 {
    width: 300px;
    height: 300px;
    bottom: -80px;
    right: -80px;
    animation-delay: 5s;
}

.circle-3 {
    width: 250px;
    height: 250px;
    top: 50%;
    right: 10%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.6;
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
        opacity: 0.8;
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
        opacity: 0.5;
    }
}

/* ============================================
   Card de Login
   ============================================ */
.login-card {
    background: var(--color-bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    position: relative;
    z-index: 10;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Header com Logo
   ============================================ */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-wrapper {
    display: inline-block;
}

.text-center {
    text-align: center;
}

.logo-img {
    display: block;
    margin: 0 auto;
    max-width: 160px;
    height: auto;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.logo-subtitle {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* ============================================
   Formulário
   ============================================ */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.label-icon {
    width: 1.125rem;
    height: 1.125rem;
    color: var(--color-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.9375rem;
    font-family: 'Poppins', sans-serif;
    color: var(--color-text-primary);
    background-color: var(--color-bg-white);
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--shadow-light);
}

.form-control::placeholder {
    color: var(--color-text-muted);
}

/* ============================================
   Password Field
   ============================================ */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper .form-control {
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--color-text-muted);
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: var(--color-primary);
}

.eye-icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* ============================================
   Form Options
   ============================================ */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -0.25rem;
}

.remember-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.remember-wrapper input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.remember-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    cursor: pointer;
    user-select: none;
    font-weight: 500;
}

.forgot-link {
    font-size: 0.875rem;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* ============================================
   Botão de Login
   ============================================ */
.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    margin-top: 0.5rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-text {
    font-weight: 600;
}

.btn-icon {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.3s ease;
}

.btn-login:hover .btn-icon {
    transform: translateX(4px);
}

/* ============================================
   Alertas
   ============================================ */
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.field-error {
    color: var(--error-color);
    font-size: 0.8125rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ============================================
   Seção de Cadastro
   ============================================ */
.signup-section {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.signup-text {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    font-weight: 500;
}

.signup-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.signup-link:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* ============================================
   Footer
   ============================================ */
.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
}

.login-footer p {
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
}

/* ============================================
   Responsividade
   ============================================ */
@media (max-width: 640px) {
    .login-card {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }

    .logo-img {
        max-width: 140px;
    }

    .logo-text {
        font-size: 1.5rem;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .gradient-circle {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   Suavização de Fontes
   ============================================ */
body,
.login-container,
.login-card {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}