/* Reset e Variáveis */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #36a74b;
    --primary-dark: #2d8a3f;
    --primary-light: #4fc465;
    --secondary-color: #1976D2;
    --accent-color: #FF6F00;
    --text-primary: #212121;
    --text-secondary: #757575;
    --background: #F5F5F5;
    --white: #FFFFFF;
    --error: #D32F2F;
    --border-color: #E0E0E0;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
    --bg-color: #0c40a3;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0c40a3 0%, #1a5fc4 50%, #0c40a3 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(54, 167, 75, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(54, 167, 75, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Container Principal */
.login-container {
    width: 100%;
    max-width: 450px;
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Box de Login */
.login-box {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 45px 35px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    width: 100%;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light), var(--primary-color));
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Seção do Logo */
.logo-section {
    text-align: center;
    margin-bottom: 35px;
}

.logo-icon {
    width: 130px;
    height: 130px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(54, 167, 75, 0.1), rgba(79, 196, 101, 0.1));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    box-shadow: 
        0 8px 32px rgba(54, 167, 75, 0.2),
        0 0 0 4px rgba(54, 167, 75, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.logo-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(54, 167, 75, 0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.logo-icon:hover {
    transform: scale(1.05);
    box-shadow: 
        0 12px 40px rgba(54, 167, 75, 0.3),
        0 0 0 4px rgba(54, 167, 75, 0.15);
}

.logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.logo-text {
    font-size: 34px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0;
    letter-spacing: -0.5px;
    position: relative;
}

.tagline {
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.6;
    margin-top: 12px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    letter-spacing: 0.3px;
}

/* Formulário */
.login-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.form-group input {
    width: 100%;
    padding: 18px 20px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 14px;
    background: var(--white);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 
        0 0 0 4px rgba(54, 167, 75, 0.12),
        0 4px 12px rgba(54, 167, 75, 0.15);
    transform: translateY(-1px);
}

.form-group input:hover:not(:focus) {
    border-color: rgba(54, 167, 75, 0.3);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.form-group input::placeholder {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Botão de Login */
.btn-login {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--white);
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 6px 20px rgba(54, 167, 75, 0.35),
        0 0 0 0 rgba(54, 167, 75, 0.5);
    margin-bottom: 20px;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-login:hover::before {
    width: 300px;
    height: 300px;
}

.btn-login:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    box-shadow: 
        0 10px 30px rgba(54, 167, 75, 0.45),
        0 0 0 4px rgba(54, 167, 75, 0.2);
}

.btn-login:active {
    transform: translateY(-1px);
    box-shadow: 
        0 4px 15px rgba(54, 167, 75, 0.35),
        0 0 0 2px rgba(54, 167, 75, 0.2);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

.btn-login.loading .btn-text {
    display: none;
}

.btn-login.loading .btn-loader {
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Preview de Funcionalidades */
.features-preview {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 28px;
    margin-top: 30px;
    position: relative;
}

.features-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    border-radius: 2px;
}

.features-title {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-weight: 500;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    text-align: center;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 8px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.feature-item:hover {
    background: rgba(54, 167, 75, 0.05);
    transform: translateY(-4px);
}

.feature-item:hover .feature-icon {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(54, 167, 75, 0.25);
}

.feature-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    margin-bottom: 8px;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-icon svg {
    width: 36px;
    height: 36px;
}

.feature-icon-health {
    background: #E8F5E9;
    color: var(--primary-color);
}

.feature-icon-education {
    background: #E8F5E9;
    color: var(--primary-color);
}

.feature-icon-training {
    background: #E8F5E9;
    color: var(--primary-color);
}

.feature-icon-diet {
    background: #E8F5E9;
    color: var(--primary-color);
}

.feature-icon-legal {
    background: #E8F5E9;
    color: var(--primary-color);
}

.feature-item span:last-child {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 600;
}

/* Responsividade para Mobile */
@media (max-width: 480px) {
    body {
        padding: 15px;
    }

    .login-box {
        padding: 35px 25px;
        border-radius: 20px;
    }

    .logo-icon {
        width: 100px;
        height: 100px;
    }

    .logo-text {
        font-size: 28px;
    }

    .tagline {
        font-size: 16px;
        max-width: 280px;
        margin-top: 10px;
    }

    .form-group label {
        font-size: 15px;
    }

    .form-group input {
        padding: 14px 16px;
        font-size: 16px; /* Mantém tamanho maior para facilitar digitação no mobile */
    }

    .btn-login {
        padding: 16px;
        font-size: 17px;
    }

    .features-grid {
        gap: 8px;
    }

    .feature-item {
        padding: 8px 3px;
    }

    .feature-icon {
        width: 50px;
        height: 50px;
    }

    .feature-icon svg {
        width: 32px;
        height: 32px;
    }

    .feature-item span:last-child {
        font-size: 12px;
    }
}

/* Acessibilidade - Foco Visível */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Animações de Erro */
.form-group.error input {
    border-color: var(--error);
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Mensagens de Erro (para uso futuro) */
.error-message {
    color: var(--error);
    font-size: 14px;
    margin-top: 8px;
    display: none;
}

.form-group.error .error-message {
    display: block;
}
