.document {
    max-width: 860px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.10);
    overflow: hidden;
}

/* ── Cabecera ── */
.header {
    background: #006837;
    color: #ffffff;
    padding: 28px 36px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.header .brand {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.header .contact-info {
    text-align: right;
    font-size: 13px;
    line-height: 1.7;
}

.header .contact-info a {
    color: #a8e6c1;
    text-decoration: none;
}

.header .contact-info a:hover {
    text-decoration: underline;
}

/* ── Subtítulo del documento ── */
.doc-title {
    background: #e8f5ee;
    border-left: 5px solid #006837;
    padding: 14px 36px;
    font-size: 15px;
    font-weight: 600;
    color: #004d28;
}

/* ── Cuerpo ── */
.body {
    padding: 28px 36px 40px;
}

/* ── Secciones ── */
.section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    color: #006837;
    border-bottom: 2px solid #006837;
    padding-bottom: 6px;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Grids de campos ── */
.fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
}

.fields-grid.three-col {
    grid-template-columns: 1fr 1fr 1fr;
}

.fields-grid.full {
    grid-template-columns: 1fr;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.field.span-2 {
    grid-column: span 2;
}

.field.span-3 {
    grid-column: span 3;
}

.field label {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.field .input-line {
    border: none;
    border-bottom: 1.5px solid #bbb;
    padding: 5px 2px;
    font-size: 13px;
    color: #1a1a1a;
    background: transparent;
    min-height: 26px;
}

.field .input-line.filled {
    color: #1a1a1a;
    font-weight: 500;
}

/* ── Tabla de partes ── */
.parties-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.party-box {
    border: 1px solid #d0e8d8;
    border-radius: 6px;
    padding: 16px 18px;
    background: #f9fdf9;
}

.party-box .party-name {
    font-size: 13px;
    font-weight: 700;
    color: #006837;
    margin-bottom: 10px;
    text-transform: uppercase;
}

/* ── Tabla de condiciones ── */
.conditions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.conditions-table th,
.conditions-table td {
    border: 1px solid #d0e8d8;
    padding: 9px 12px;
    vertical-align: top;
}

.conditions-table th {
    background: #e8f5ee;
    color: #004d28;
    font-weight: 600;
    width: 30%;
}

.conditions-table td {
    background: #ffffff;
    line-height: 1.6;
}

/* ── Nota informativa ── */
.info-note {
    background: #fffbe6;
    border-left: 4px solid #f0c040;
    padding: 10px 14px;
    font-size: 12px;
    color: #5a4a00;
    border-radius: 0 4px 4px 0;
    margin: 10px 0;
    line-height: 1.6;
}

/* ── Condiciones de adhesión ── */
.conditions-list {
    list-style: none;
    padding: 0;
}

.conditions-list li {
    padding: 8px 0 8px 20px;
    border-bottom: 1px solid #eef4ee;
    font-size: 13px;
    line-height: 1.6;
    position: relative;
}

.conditions-list li::before {
    content: "▸";
    color: #006837;
    position: absolute;
    left: 0;
    top: 8px;
}

.conditions-list li:last-child {
    border-bottom: none;
}

.conditions-list li strong {
    color: #004d28;
}

/* ── Tabla de protección de datos ── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table tr:nth-child(even) td {
    background: #f4faf6;
}

.data-table tr:nth-child(odd) td {
    background: #ffffff;
}

.data-table td {
    border: 1px solid #d0e8d8;
    padding: 8px 12px;
    vertical-align: top;
    line-height: 1.6;
}

.data-table td:first-child {
    font-weight: 700;
    color: #004d28;
    width: 22%;
    background: #e8f5ee !important;
}

/* ── Comunicaciones comerciales ── */
.comm-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eef4ee;
    font-size: 13px;
    line-height: 1.5;
    gap: 16px;
}

.comm-question:last-child {
    border-bottom: none;
}

.comm-question .question-text {
    flex: 1;
}

.comm-options {
    display: flex;
    gap: 16px;
    flex-shrink: 0;
}

.comm-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
}

.comm-options input[type="radio"] {
    accent-color: #006837;
    width: 15px;
    height: 15px;
}

/* ── Sección de firma ── */
.signature-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 8px;
}

.signature-box {
    border: 1px solid #d0e8d8;
    border-radius: 6px;
    padding: 16px 18px;
    background: #f9fdf9;
}

.signature-box .sig-title {
    font-size: 12px;
    font-weight: 700;
    color: #006837;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.sig-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 12px;
}

.sig-date .date-field {
    border-bottom: 1.5px solid #bbb;
    width: 36px;
    text-align: center;
    padding: 2px 0;
}

.sig-area {
    border: 1.5px dashed #bbb;
    border-radius: 4px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 12px;
    margin-top: 8px;
}

.sig-representative {
    font-size: 12px;
    color: #555;
    margin-top: 8px;
    font-style: italic;
}

/* ── Documentos a anexar ── */
.attach-box {
    background: #f0f4ff;
    border-left: 4px solid #3a5fc8;
    border-radius: 0 6px 6px 0;
    padding: 12px 16px;
    font-size: 13px;
    color: #1a2a5e;
    line-height: 1.7;
}

/* ── Footer ── */
.footer {
    background: #006837;
    color: #a8e6c1;
    text-align: center;
    padding: 14px 36px;
    font-size: 12px;
}

.footer a {
    color: #a8e6c1;
}

/* ── Responsive ── */
@media (max-width: 600px) {

    .parties-grid,
    .signature-section,
    .fields-grid,
    .fields-grid.three-col {
        grid-template-columns: 1fr;
    }

    .field.span-2,
    .field.span-3 {
        grid-column: span 1;
    }

    .header {
        flex-direction: column;
        text-align: center;
    }

    .header .contact-info {
        text-align: center;
    }

    .body {
        padding: 20px 16px 32px;
    }
}