*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body{
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f4f7fb;
    color: #1f2937;
    min-height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;
}

.home-container{
    background-color: white;
    width: 100%;
    max-width: 500px;

    padding: 40px;

    border-radius: 16px;

    box-shadow: 0 10px 30px rgba(0,0,0,0.08);

    text-align: center;
}

.home-title{
    font-size: 32px;
    margin-bottom: 10px;
}

.home-subtitle{
    color: #6b7280;
    margin-bottom: 35px;
}

.home-actions{
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.home-link{
    text-decoration: none;

    background-color: #111827;
    color: white;

    padding: 14px;

    border-radius: 10px;

    transition: 0.2s ease;
}

.home-link:hover{
    background-color: #374151;

    transform: translateY(-2px);
}


.page-container{
    width: 100%;
    max-width: 900px;

    margin: 40px auto;

    padding: 20px;
}

.page-title{
    font-size: 36px;
    margin-bottom: 10px;
}

.page-description{
    color: #6b7280;
    margin-bottom: 30px;
}

.alert{
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.alert-success{
    background-color: #dcfce7;
    color: #166534;
}

.alert-error{
    background-color: #fee2e2;
    color: #991b1b;
}

.top-actions{
    margin-bottom: 30px;
}

.primary-button{
    display: inline-block;

    background-color: #111827;
    color: white;

    text-decoration: none;

    padding: 12px 18px;

    border-radius: 10px;

    transition: 0.2s ease;
}

.primary-button:hover{
    background-color: #374151;
}

.habits-grid{
    display: grid;

    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));

    gap: 20px;
}

.habit-card{
    background-color: white;

    border-radius: 16px;

    padding: 20px;

    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}

.habit-title{
    font-size: 22px;
    margin-bottom: 10px;
}

.habit-description{
    color: #6b7280;
    margin-bottom: 15px;
}

.habit-frequency{
    margin-bottom: 20px;
    font-size: 14px;
}

.complete-button{
    width: 100%;

    background-color: #10b981;
    color: white;

    border: none;

    padding: 12px;

    border-radius: 10px;

    cursor: pointer;

    transition: 0.2s ease;
}

.complete-button:hover{
    background-color: #059669;
}

.empty-message{
    background-color: white;

    padding: 20px;

    border-radius: 12px;

    text-align: center;
}

.back-link{
    display: inline-block;

    margin-top: 30px;

    text-decoration: none;

    color: #111827;

    font-weight: bold;
}

.form-page{
    width: 100%;
    min-height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;

    background-color: #f4f7fb;

    padding: 30px;
}

.form-card{
    width: 100%;
    max-width: 550px;

    background-color: white;

    padding: 35px;

    border-radius: 18px;

    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.form-title{
    font-size: 32px;

    margin-bottom: 10px;

    text-align: center;
}

.form-subtitle{
    text-align: center;

    color: #6b7280;

    margin-bottom: 30px;
}

.form-group{
    margin-bottom: 20px;
}

.form-label{
    display: block;

    margin-bottom: 8px;

    font-weight: bold;
}

.form-input,
.form-textarea,
.form-select{
    width: 100%;

    padding: 12px;

    border: 1px solid #d1d5db;

    border-radius: 10px;

    font-size: 15px;
}

.form-textarea{
    resize: vertical;
    min-height: 120px;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus{
    outline: none;

    border-color: #111827;
}

.form-error{
    color: #dc2626;

    font-size: 14px;

    margin-top: 6px;
}

.form-actions{
    display: flex;
    gap: 15px;

    margin-top: 25px;
}

.submit-button{
    flex: 1;

    border: none;

    background-color: #111827;
    color: white;

    padding: 14px;

    border-radius: 10px;

    cursor: pointer;

    transition: 0.2s ease;
}

.submit-button:hover{
    background-color: #374151;
}

.back-button{
    flex: 1;

    text-align: center;

    text-decoration: none;

    background-color: #e5e7eb;

    color: #111827;

    padding: 14px;

    border-radius: 10px;

    transition: 0.2s ease;
}

.back-button:hover{
    background-color: #d1d5db;
}

.delete-button{
    width: 100%;

    background-color: #ef4444; /* rojo */
    color: white;

    border: none;

    padding: 12px;

    border-radius: 10px;

    cursor: pointer;

    margin-top: 10px;

    transition: 0.2s ease;
}

.delete-button:hover{
    background-color: #dc2626;
    transform: translateY(-2px);
}

.edit-button{
    display: block;
    width: 100%;

    background-color: #3b82f6; 

    text-align: center;
    text-decoration: none;

    padding: 12px;

    border-radius: 10px;

    margin-top: 10px;

    transition: 0.2s ease;
}

.edit-button:hover{
    background-color: #2563eb;
    transform: translateY(-2px);
}

/* --- Estadísticas generales --- */

.stats-grid{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.stat-card{
    background-color: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}

.stat-title{
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-value{
    font-size: 42px;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-value.green{
    color: #10b981;
}

.stat-value.blue{
    color: #3b82f6;
}

.stat-text{
    color: #6b7280;
    font-size: 14px;
    margin-top: 5px;
}
.auth-page{
    width: 100%;
    min-height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;

    background-color: #f4f7fb;

    padding: 20px;
}

.auth-card{
    width: 100%;
    max-width: 450px;

    background-color: white;

    padding: 40px;

    border-radius: 18px;

    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.auth-title{
    text-align: center;

    font-size: 34px;

    margin-bottom: 10px;
}

.auth-subtitle{
    text-align: center;

    color: #6b7280;

    margin-bottom: 30px;
}

.auth-form-group{
    margin-bottom: 20px;
}

.auth-label{
    display: block;

    margin-bottom: 8px;

    font-weight: bold;
}

.auth-input{
    width: 100%;

    padding: 12px;

    border: 1px solid #d1d5db;

    border-radius: 10px;

    font-size: 15px;
}

.auth-input:focus{
    outline: none;

    border-color: #111827;
}

.auth-error{
    color: #dc2626;

    font-size: 14px;

    margin-top: 6px;
}

.auth-button{
    width: 100%;

    border: none;

    background-color: #111827;

    color: white;

    padding: 14px;

    border-radius: 10px;

    cursor: pointer;

    transition: 0.2s ease;

    margin-top: 10px;
}

.auth-button:hover{
    background-color: #374151;
}

.auth-footer{
    text-align: center;

    margin-top: 25px;
}

.auth-link{
    text-decoration: none;

    color: #111827;

    font-weight: bold;
}
