@import "./globals.css";

.header {
    background-color: transparent;
}

/* Container principal */
.page-container {
    max-width: 1280px;
    width: 100%;
    min-height: 100vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Background Elements */
.bg-elements {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 1;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(115, 155, 97, 0.1) 0%, rgba(102, 126, 234, 0.1) 100%);
    border: 1px solid rgba(115, 155, 97, 0.2);
    animation: float 8s ease-in-out infinite;
}

.shape-1 {
    width: 200px;
    height: 200px;
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 150px;
    height: 150px;
    bottom: -75px;
    left: -75px;
    animation-delay: 2s;
}

.shape-3 {
    width: 100px;
    height: 100px;
    top: 30%;
    left: 10%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg) scale(1); 
        opacity: 0.7;
    }
    50% { 
        transform: translateY(-20px) rotate(180deg) scale(1.1); 
        opacity: 1;
    }
}

.gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(115, 155, 97, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(102, 126, 234, 0.05) 0%, transparent 50%);
    z-index: 2;
}

/* Header */
.header {
    width: 100%;
    padding: 2rem 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 10;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    max-width: 200px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(115, 155, 97, 0.2));
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 6px 12px rgba(115, 155, 97, 0.3));
}

/* Main Content */
.main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 10;
}

.login-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.card-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-title);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.card-header p {
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 500;
}

/* Formulário */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-fields {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-title);
    letter-spacing: 0.02em;
}

.field-group label i {
    color: var(--color-primary);
    font-size: 0.8rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background: var(--color-surface);
    color: var(--color-text);
    transition: var(--transition);
    box-sizing: border-box;
    font-family: var(--font-base);
}

.input-wrapper input::placeholder {
    color: var(--color-placeholder);
    font-size: 0.95rem;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-surface);
    box-shadow: 0 0 0 4px rgba(115, 155, 97, 0.1);
}

.toggle-password {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--color-placeholder);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-default);
    transition: var(--transition);
    z-index: 2;
}

.toggle-password:hover {
    color: var(--color-primary);
    background: rgba(115, 155, 97, 0.1);
}

/* Opções do formulário */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--color-text);
    flex: 1;
    min-width: 160px;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-default);
    position: relative;
    transition: var(--transition);
    flex-shrink: 0;
    background: var(--color-surface);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark {
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(115, 155, 97, 0.3);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
}

.forgot-password {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
    padding: 0.5rem 0rem;
    border-radius: var(--radius-default);
}

.forgot-password:hover {
    color: var(--color-primary-dark);
    background: rgba(115, 155, 97, 0.1);
    text-decoration: none;
}

/* Botões */
.form-buttons {
    display: flex;
    flex-direction: column;
    /* gap: 1.5rem; */
}

.form-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-base);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.form-btn.primary-btn {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.form-btn.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.form-btn.primary-btn:active {
    transform: translateY(0);
}

.form-btn.secondary-btn {
    background: var(--color-surface);
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.form-btn.secondary-btn:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.form-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Divisor */
.divider {
    text-align: center;
    position: relative;
    margin: 1rem 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--color-border);
}

.divider span {
    background: var(--color-surface);
    padding: 0 1rem;
    color: var(--color-placeholder);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Footer */
.footer {
    padding: 1.5rem;
    text-align: center;
    position: relative;
    z-index: 10;
}

.footer p {
    color: var(--color-text);
    font-size: 0.775rem;
    font-weight: 500;
}

/* Responsividade */
@media (max-width: 768px) {
    .header {
        padding: 1.5rem 1rem;
    }
    
    .logo {
        max-width: 160px;
    }
    
    .main {
        padding: 1.5rem 1rem;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
        border-radius: var(--radius-lg);
    }
    
    .card-header h2 {
        font-size: 1.75rem;
    }
    
    .form-options {
        /* flex-direction: column; */
        align-items: center;
        gap: 1rem;
    }
    
    .checkbox-wrapper {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1rem 0.75rem;
    }
    
    .logo {
        max-width: 140px;
    }
    
    .main {
        padding: 1rem 0.75rem;
    }
    
    .login-card {
        padding: 1.5rem 1rem;
        border-radius: var(--radius-md);
    }
    
    .card-header h2 {
        font-size: 1.5rem;
    }
    
    .card-header p {
        font-size: 0.8rem;
    }
    
    .input-wrapper input {
        padding: 0.875rem;
        font-size: 0.95rem;
    }
    
    .form-btn {
        padding: 0.875rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 360px) {
    .header {
        padding: 0.75rem 0.5rem;
    }
    
    .logo {
        max-width: 120px;
    }
    
    .main {
        padding: 0.75rem 0.5rem;
    }
    
    .login-card {
        padding: 1.25rem 0.75rem;
        border-radius: var(--radius-md);
    }
    
    .card-header h2 {
        font-size: 1.25rem;
    }
    
    .card-header p {
        font-size: 0.85rem;
    }
}

/* Animações de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    animation: fadeInUp 0.6s ease-out;
}

/* Estados de hover e focus aprimorados */
.form-btn:hover {
    transform: translateY(-2px);
}

.form-btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(115, 155, 97, 0.2);
}

/* Melhorias de acessibilidade */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Modo escuro (opcional) */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #1a1a1a;
        --color-surface: #2d2d2d;
        --color-text: #e0e0e0;
        --color-title: #ffffff;
        --color-border: #404040;
        --color-placeholder: #808080;
    }
    
    .page-container {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    }
}