@import url('https://fonts.googleapis.com/css2?family=Pacifico&family=Quicksand:wght@400;600;700&display=swap');

/* Estilos Gerais */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Estilo do Corpo da Página de Login */
.login-body {
    font-family: 'Quicksand', sans-serif;
    background: #0f172a; /* Azul escuro/ardósia */
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #e2e8f0; /* Cinza claro para texto */
    overflow: hidden;
}

/* Container de Login e Caixa */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.login-box {
    width: 100%;
    max-width: 400px;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 40px 35px;
    text-align: center;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Avatar */
.avatar-container {
    margin: -100px auto 20px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Títulos e Textos do Login */
.login-box h2 {
    font-family: 'Pacifico', cursive;
    color: #ffffff;
    font-size: 2.8rem;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}
.login-subtitle {
    color: #cbd5e1;
    margin-bottom: 25px;
    font-weight: 600;
}
.login-error {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Grupo de Inputs */
.input-group {
    position: relative;
    margin-bottom: 20px;
}
.input-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: #94a3b8;
}
.form-control {
    width: 100%;
    padding: 15px 20px 15px 50px;
    border: 1px solid #334155;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    background-color: #1e293b;
    color: #e2e8f0;
}
.form-control::placeholder {
    color: #64748b;
}
.form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Botão de Login */
.btn-login {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(45deg, #3b82f6, #60a5fa);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}
.btn-login:active {
    transform: translateY(0);
}


/* --- ESTILOS DA PÁGINA PRINCIPAL (TAREFAS) --- */

/* Estilo do Corpo Principal */
.main-body {
    font-family: 'Quicksand', sans-serif;
    background-color: #f0f4f8; /* Um fundo mais claro para a área principal */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Alinha o container no topo */
    padding: 0; /* MODIFICADO: Remove o espaçamento externo para o layout full-width */
    min-height: 100vh;
}

/* Container Principal */
.container {
    width: 100%;
    max-width: none; /* MODIFICADO: Permite que o container ocupe a largura total */
    background-color: #ffffff;
    border-radius: 0; /* MODIFICADO: Remove os cantos arredondados */
    box-shadow: none; /* MODIFICADO: Remove a sombra para um visual integrado */
    padding: 30px;
    position: relative;
    min-height: 100vh;
}

.logout-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #f472b6;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}
.logout-btn:hover {
    background-color: #ec4899;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}


header {
    text-align: center;
    margin-bottom: 25px;
    max-width: 650px; /* Adicionado para manter o cabeçalho centralizado e legível */
    margin-left: auto;
    margin-right: auto;
}

header h1 {
    font-family: 'Pacifico', cursive;
    color: #3b82f6;
    font-size: 3.5rem;
    margin-top: 10px;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.1rem;
    color: #475569;
    margin-bottom: 15px;
    font-weight: 600;
}

.avatar-container-main {
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 4px solid white;
}
.avatar-img-main {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* Seção Nova Tarefa */
.nova-tarefa {
    display: flex;
    margin-bottom: 25px;
    gap: 12px;
    max-width: 650px; /* Adicionado para manter a área de input centralizada */
    margin-left: auto;
    margin-right: auto;
}

#tarefa-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s ease;
    background-color: #f8fafc;
}

#tarefa-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
    background-color: white;
}

#adicionar-btn {
    background: #3b82f6;
    border: none;
    border-radius: 15px;
    width: 60px;
    height: auto;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    flex-shrink: 0;
}
#adicionar-btn:hover {
    background: #2563eb;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    transform: scale(1.05);
}
#adicionar-btn .icon {
    width: 28px;
    height: 28px;
}

/* Container da Lista de Tarefas */
.lista-tarefas-container {
    min-height: 150px;
    position: relative;
    max-width: 650px; /* Adicionado para manter a lista de tarefas centralizada */
    margin-left: auto;
    margin-right: auto;
}

/* Listas de Tarefas (UL) */
#lista-tarefas-ul, #lista-concluidas-ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#lista-tarefas-ul li, #lista-concluidas-ul li {
    background-color: #f8fafc;
    margin-bottom: 15px;
    padding: 15px 20px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    animation: fadeIn 0.4s ease-out;
}
#lista-tarefas-ul li:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
#lista-tarefas-ul li span, #lista-concluidas-ul li span {
    flex: 1;
    font-size: 1.1rem;
    word-break: break-word;
    padding-right: 15px;
    font-weight: 600;
    color: #334155;
}

/* Tarefas Concluídas */
#concluidas-section {
    margin-top: 30px;
}
.concluidas-header {
    font-weight: bold;
    color: #64748b;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 2px solid #e2e8f0;
}
#lista-concluidas-ul li {
    background-color: #f1f5f9;
    opacity: 0.7;
}
#lista-concluidas-ul li span {
    text-decoration: line-through;
    color: #64748b;
}

/* Botões de Ação */
.botoes-acao {
    display: flex;
    gap: 10px;
}
.botao-concluir, .botao-excluir {
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    background: transparent;
}
.botao-concluir svg, .botao-excluir svg {
    width: 20px;
    height: 20px;
    stroke: #94a3b8;
    transition: stroke 0.3s ease;
}
.botao-concluir:hover svg {
    stroke: #22c55e;
}
.botao-excluir:hover svg {
    stroke: #ef4444;
}

/* Estado Vazio */
.empty-state-container {
    text-align: center;
    padding: 40px 20px;
    width: 100%;
}
.empty-state-svg {
    width: 120px;
    height: auto;
    margin-bottom: 20px;
    opacity: 0.8;
}
.empty-state-container h3 {
    font-size: 1.3rem;
    color: #475569;
    margin-bottom: 10px;
}
.empty-state-container p {
    color: #64748b;
}

/* Controles Finais */
.controles-finais {
    text-align: center;
    margin-top: 30px;
    max-width: 650px; /* Adicionado para manter o botão centralizado */
    margin-left: auto;
    margin-right: auto;
}
#clear-completed-btn {
    background-color: #ef4444;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}
#clear-completed-btn:hover {
    background-color: #dc2626;
    transform: scale(1.05);
}

.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}


/* --- RESPONSIVIDADE --- */

/* Para tablets e ecrãs menores (até 768px) */
@media (max-width: 768px) {
    .main-body {
        padding: 0; /* MODIFICADO: Mantém o corpo sem espaçamento */
    }

    .container {
        padding: 25px;
    }

    header h1 {
        font-size: 2.8rem;
    }

    .login-box {
        padding: 30px 25px;
    }

    .login-box h2 {
        font-size: 2.4rem;
    }
}

/* Para telemóveis (até 480px) */
@media (max-width: 480px) {
    .main-body {
        padding: 0; /* MODIFICADO: Mantém o corpo sem espaçamento */
        align-items: flex-start;
    }

    .container {
        padding: 20px 15px;
    }

    .logout-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
        top: 15px;
        right: 15px;
    }

    header h1 {
        font-size: 2.2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }

    .avatar-container-main {
        width: 80px;
        height: 80px;
    }

    .nova-tarefa {
        flex-direction: column;
        gap: 10px;
    }

    #tarefa-input {
        padding: 12px 15px;
        font-size: 1rem;
    }

    #adicionar-btn {
        width: 100%;
        height: 50px;
    }
    
    #lista-tarefas-ul li, #lista-concluidas-ul li {
        padding: 12px 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    #lista-tarefas-ul li span, #lista-concluidas-ul li span {
        font-size: 1rem;
        padding-right: 0;
    }
    
    .botoes-acao {
        align-self: flex-end; /* Alinha os botões à direita */
    }

    /* Ajustes na página de login para telemóveis */
    .login-body {
        align-items: flex-start;
        padding-top: 50px;
    }

    .login-box {
        padding: 30px 20px;
        margin: 0 10px;
    }

    .avatar-container {
        width: 100px;
        height: 100px;
        margin-top: -80px;
    }

    .login-box h2 {
        font-size: 2rem;
    }

    .form-control {
        padding: 12px 15px 12px 45px;
    }

    .btn-login {
        padding: 12px;
    }
}