/* ==========================================================================
 *    ESTILS MODERNS, NETS I RESPONSIVE (s.css)
 *       ========================================================================== */

/* Forcem que tots els elements calculin l'amplada incloent marges i padding */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Configuració del fons de la pantalla i tipografia */
body {
    background-color: #f4f6f9; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #2d3748;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Capçalera superior amb el color blau corporatiu original (rgb(0,20,137)) */
.main-header {
    background-color: #001489; 
    color: #ffffff;
    text-align: center;
    padding: 25px 15px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.main-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Contenidor de contingut centrat a la pantalla */
.content-container {
    max-width: 650px;
    margin: 40px auto; 
    padding: 0 20px;
}

/* Secció per al logotip "UBICAT" */
.icon-section {
    text-align: center;
    margin-bottom: 35px;
}

.ubicat-icon {
    max-width: 100%;
    width: 220px; 
    height: auto;
    border-radius: 24px; 
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.05));
}

/* La targeta (Card) blanca principal */
.selection-card {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 40px 35px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.selection-card h2 {
    font-size: 1.3rem;
    color: #4a5568;
    font-weight: 600;
    margin-bottom: 0;
}

/* Reixeta (Grid) de la pàgina d'inici general */
.centers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 20px;
    margin-top: 30px;
}

/* Estil base comú per a les dues micro-cards/botons de l'arrel */
.center-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px 20px;
    border-radius: 12px;
    text-decoration: none; 
    transition: all 0.2s ease-in-out;
}

.center-card:hover {
    transform: translateY(-4px); 
}

/* --- DISSENY ESPECÍFIC PER A FEE (Vermellós difuminat) --- */
.card-fee {
    background: linear-gradient(145deg, #ffffff 0%, #fff5f5 100%) !important;
    border: 2px solid #fbd3d3 !important; 
}

/* --- DISSENY ESPECÍFIC PER A FD (Blau difuminat) --- */
.card-fd {
    background: linear-gradient(145deg, #ffffff 0%, #f0f7ff 100%);
    border: 2px solid #cbdcf7; 
    color: #001489;
}

.card-fd:hover {
    border-color: #001489;
    background: #eff6ff;
    box-shadow: 0 12px 20px -5px rgba(0, 20, 137, 0.15);
}

/* Títols interns de l'arrel */
.center-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.card-fee .center-title { color: #b91c1c; }
.card-fd .center-title { color: #001489; }

.card-fee .center-subtitle, 
.card-fd .center-subtitle {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
}

/* ==========================================================================
 *    ESTILS PER ALS MENÚS INTERNS DE LA CARD DE FEE
 *       ========================================================================== */

/* Capçalera del Portal Públic dins la Card */
.card-header-fee {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid #fbd3d3;
    padding-bottom: 15px;
}

.card-header-fee h2 {
    color: #b91c1c;
    font-size: 1.4rem;
    font-weight: 700;
}

.badge-curs {
    font-size: 0.9rem;
    background-color: #fff0f0;
    color: #b91c1c;
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid #fbd3d3;
}

/* Grup de menús en llista vertical */
.menu-group {
    display: flex;
    flex-direction: column; /* Força que els links vagin un sota l'altre */
    gap: 10px; /* Separació entre botons */
}

.group-separator {
    margin-top: 20px;
    border-top: 1px solid #fbd3d3;
    padding-top: 20px;
}

/* Botons de llista de la FEE */
.fee-list-link {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid #fbd3d3;
    border-radius: 10px;
    color: #4a5568; /* Color de text fosc i elegant, no el blau de navegador */
    text-decoration: none; /* Fora el subratllat blau lletig! */
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

/* Hover de les files */
.fee-list-link:hover {
    background-color: #ffffff;
    border-color: #b91c1c;
    color: #b91c1c; /* El text es torna vermell en passar el ratolí */
    transform: translateX(5px); /* Petit desplaçament a la dreta */
    box-shadow: 0 4px 6px rgba(185, 28, 28, 0.08);
}

/* Enllaç destacat de l'Agenda */
.highlight-fee {
    background-color: #fff1f2;
    color: #b91c1c;
    font-weight: 600;
    border-left: 4px solid #b91c1c;
}

.highlight-fee:hover {
    background-color: #ffe4e6;
}

.fee-list-link .arrow {
    font-size: 1.4rem;
    line-height: 1;
    margin-right: 12px;
    color: #b91c1c;
}

/* ==========================================================================
 *    MEDIA QUERIES (ADAPTACIÓ AUTOMÀTICA A MÒBILS SMARTPHONES)
 *       ========================================================================== */
@media (max-width: 520px) {
    .content-container { margin: 20px auto; }
    .centers-grid { grid-template-columns: 1fr; gap: 15px; }
    .selection-card { padding: 30px 20px; }
    .main-header h1 { font-size: 1.25rem; }
    .card-header-fee { flex-direction: column; align-items: flex-start; gap: 10px; }
}
