/* =============================================================
   Estils corporatius Generalitat de Catalunya
   Aplicable a: index.html, AssistenciaViatge.jsp i derivats
   ============================================================= */

/* --- #2 Tipografia: Open Sans --- */
body { font-family: 'Open Sans', Arial, Helvetica, sans-serif !important; }

/* --- Colors corporatius --- */
:root {
    --ds-color-primary:      #c1001f;
    --ds-color-primary-dark: #8a0016;
    --ds-focus-ring: 0 0 0 2px #ffffff, 0 0 0 4px #c1001f;
}

/* --- #1 Capçalera: franja vermella inferior corporativa --- */
.ds-header {
    border-bottom: 4px solid #c1001f !important;
}

/* --- #4 Targetes: difuminat radial suau vermell --- */
.ds-card {
    background: radial-gradient(ellipse 85% 80% at 10% 10%,
        rgba(193, 0, 31, 0.07) 0%,
        rgba(255, 255, 255, 1) 58%) !important;
    border-color: #e0cccc;
}

/* --- #4 Colors: paleta corporativa, eliminar blau de navegador --- */
a, a:link, a:visited { color: #4d7aff; text-decoration: none; }
a:hover              { color: #c1001f; text-decoration: underline; }

/* --- Boto primari: vermell + text blanc --- */
a.ds-link-action,
a.ds-link-action:link,
a.ds-link-action:visited {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid #c1001f;
    font-weight: 600;
    text-decoration: none;
    background-color: #c1001f;
    color: #ffffff !important;
}

a.ds-link-action:hover {
    background-color: #8a0016;
    border-color: #8a0016;
    color: #ffffff !important;
    text-decoration: none;
}

a.ds-link-action:active {
    background-color: #8a0016;
    color: #ffffff !important;
}

/* --- #6 Peu de pagina corporatiu fosc --- */
.ds-footer {
    background-color: #2e2e2e;
    border-top: 4px solid #c1001f;
}

.ds-footer__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    color: #cccccc;
}

.ds-footer__inner > span {
    color: #cccccc;
    font-size: 0.85rem;
}

.ds-footer__links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
}

.ds-footer__links a,
.ds-footer__links a:link,
.ds-footer__links a:visited {
    color: #cccccc !important;
    font-size: 0.85rem;
    text-decoration: none;
}

.ds-footer__links a:hover {
    color: #ffffff !important;
    text-decoration: underline;
}

/* =============================================================
   Estils especifics AssistenciaViatge.jsp (i formularis similars)
   ============================================================= */

/* --- Procediment badge (capçalera del formulari) --- */
.ds-procediment-row td {
    border-top: 14px solid transparent;
    padding: 0;
    vertical-align: middle;
}
.ds-procediment-label {
    padding: 6px 0;
    width: 140px;
    text-align: right;
    padding-right: 0;
}
.ds-procediment-value {
    padding: 6px 0;
    padding-left: 0;
}
.ds-procediment-badge {
    display: inline-block;
    background: #eef0f3;
    border: 1px solid #cfd6df;
    padding: 10px 14px;
    margin: 0;
    box-shadow: 0 1px 0 rgba(0,0,0,.03);
    font-weight: 600;
    color: #2b2f36;
    line-height: 1;
    vertical-align: middle;
}
.ds-procediment-label .ds-procediment-badge {
    font-weight: 700;
    border-right: 0;
    border-radius: 8px 0 0 8px;
    padding-right: 12px;
}
.ds-procediment-value .ds-procediment-badge {
    border-left: 0;
    border-radius: 0 8px 8px 0;
    padding-left: 12px;
}

/* --- Camp requerit: sense fons ni recuadre --- */
.ds-form-grid-required,
.ds-form-grid-required * {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* --- Boto "Pagina Principal" (peu del formulari) --- */
.ds-footer-nav {
    margin: 28px 0 16px;
    text-align: center;
}
.ds-home-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #cfd6df;
    background: #ffffff;
    color: #1f2a44;
    text-decoration: none;
    border-radius: 10px;
    box-shadow: 0 1px 0 rgba(0,0,0,.03);
    font-weight: 600;
    line-height: 1;
}
.ds-home-button:hover {
    background: #f6f8fb;
    border-color: #b9c4d3;
    color: #1f2a44;
    text-decoration: none;
}
.ds-home-button:focus {
    outline: 3px solid #c1001f;
    outline-offset: 2px;
}
.ds-home-button__icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    flex: 0 0 auto;
}

/* --- Botons d'accio del formulari --- */
.ds-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.ds-button {
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    border: 1px solid transparent;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}
.ds-button--primary {
    background-color: #c1001f;
    border-color: #c1001f;
    color: #ffffff;
}
.ds-button--primary:hover {
    background-color: #8a0016;
    border-color: #8a0016;
}
.ds-button--secondary {
    background-color: #ffffff;
    border-color: #c1001f;
    color: #c1001f;
}
.ds-button--secondary:hover {
    background-color: #fff0f0;
}

/* --- #5 Disseny responsiu --- */
@media (max-width: 640px) {
    .ds-main__inner   { padding: 1rem 0.75rem; gap: 1rem; }
    .ds-card          { padding: 1rem; }
    .ds-card__title   { font-size: 1.1rem; }
    .ds-footer__inner { flex-direction: column; align-items: flex-start; }
}

/* =============================================================
   Estils resposta (response.jsp)
   ============================================================= */
.ds-response-card {
    background: #f6f8fb;
    border: 1px solid #cfd6df;
    border-radius: 10px;
    padding: 40px 48px;
    margin: 32px auto;
    max-width: 680px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.ds-response-card__procediment {
    font-size: 1.15em;
    font-weight: 700;
    color: #2b2f36;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #dde3ec;
}
.ds-response-card__message {
    font-size: 1em;
    color: #1f2a44;
    margin-bottom: 32px;
    line-height: 1.6;
}
.ds-response-card__actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* =============================================================
   Estils instancia Obs (instancia_Obs_AssistenciaViatge.jsp
   i instancia_Obs_AssistenciaViatgeIndividual.jsp)
   ============================================================= */
/* Ocultar capçalera legacy dins el contenidor pare */
body > table:first-of-type { display: none; }

/* Etiquetes en negreta (columna esquerra) */
#personesGrupElements td.tdd:first-child,
#personesElements td.tdd:first-child {
    font-weight: bold;
}

/* =============================================================
   Estils fragments WEB-INF/jsp
   ============================================================= */
.ds-grup-fields td.tdd:first-child { font-weight: bold; }

/* =============================================================
   Estils extrets d'inline styles de DanysMaterials.jsp
   ============================================================= */

/* Etiqueta de documentacio annexa (TD esquerra) */
.ds-doc-annexa-label {
    vertical-align: middle;
    width: 15em;
}

/* Icona clicable (cursor pointer sense style inline) */
.ds-icon-clickable {
    cursor: pointer;
}

/* Visibilitat oculta inicial (substitueix style="visibility:hidden;") */
.ds-visibility-hidden {
    visibility: hidden;
}
