:root {
    --verde-institucional: #009638;
    --font-base: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ========================================== */
/* 1. BASE Y LAYOUT GENERAL                   */
/* ========================================== */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    font-family: var(--font-base);
    background-color: #f8f9fa;
    margin: 0;
    padding: 0; 
}

.main-content {
    padding-top: 120px;
    padding-bottom: 80px;
    padding-left: 20px;
    padding-right: 20px;
    min-height: calc(100vh - 200px);
}

/* ========================================== */
/* 2. SECCIÓN INTRODUCCIÓN                    */
/* ========================================== */
.intro-seccion {
    max-width: 850px;
    margin: 20px auto 50px auto;
    text-align: left;
    padding: 0; 
}

.intro-seccion h1 {
    color: var(--verde-institucional);
    font-size: 2.8em;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 30px;
}

.intro-seccion h1 span {
    font-weight: 300;
    color: #333;
}

.intro-texto {
    font-size: 1.15em;
    color: var(--gris-texto);
    line-height: 1.8;
    border-left: 6px solid var(--verde-institucional);
    padding-left: 25px;
    text-align: left;
    background-color: white;
    padding: 25px;
    border-radius: 0 15px 15px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.intro-texto p:first-child {
    margin-top: 0;
}

/* ========================================== */
/* 3. POLÍTICAS (LISTA)                       */
/* ========================================== */
.politica-container {
max-width: 850px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr; /* Una sola columna que ocupa todo el ancho */
    grid-auto-rows: 1fr; /* Obliga a que TODAS las filas midan lo mismo que la más alta */
    gap: 25px;
    padding: 0;
}

.politica-punto {
    position: relative;
    display: flex;
    align-items: stretch;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.politica-punto:hover {
    transform: translateX(8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.icon-badge {
    position: absolute;
    top: 50%;
    left: -28px;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--verde-institucional);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3em;
    border: 4px solid white;
    box-shadow: 2px 4px 10px rgba(0,0,0,0.15);
    z-index: 10;
}

.politica-left-col {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    background-color: var(--verde-institucional);
    color: white;
    border-radius: 11px 0 0 11px;
    padding-left: 10px;
}

.politica-number {
    font-size: 3.5em;
    font-weight: 800;
    line-height: 1;
    opacity: 0.9;
}

.politica-text-col {
    flex: 1;
    padding: 25px 35px;
    display: flex;
    align-items: center;
}

.politica-text {
    margin: 0;
    line-height: 1.6;
    font-size: 1.1em;
    color: var(--gris-texto);
}

/* ========================================== */
/* 4. FORMULARIO DE CONTACTO                  */
/* ========================================== */
.contacto-ambiental-container {
    max-width: 850px;
    margin: 60px auto 0 auto;
    padding: 0;
}

.form-card {
    background: white;
    padding: 40px;
    border-radius: 0 20px 20px 0;
    border-left: 6px solid var(--verde-institucional);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    position: relative;
}

.form-header h2 {
    color: var(--verde-institucional);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 1.8em;
    margin-bottom: 10px;
}

.form-header p {
    color: #666;
    margin-bottom: 30px;
}

.custom-input {
    background-color: #f1f3f5 !important;
    border: 2px solid transparent !important;
    border-radius: 10px !important;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.custom-input:focus {
    background-color: white !important;
    border-color: var(--verde-institucional) !important;
    box-shadow: 0 0 0 4px rgba(0, 150, 56, 0.1) !important;
    outline: none;
}

.tipo-solicitud-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    height: 100%;
}

.custom-radio .form-check-input:checked {
    background-color: var(--verde-institucional);
    border-color: var(--verde-institucional);
}

.btn-submit-ambiental {
    background-color: var(--verde-institucional);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-submit-ambiental:hover {
    background-color: #007a2d;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Fuerza mayúsculas en el input de fecha y placeholders */
input[type="date"], 
input[type="date"]::placeholder {
    text-transform: uppercase;
}

/* ========================================== */
/* 5. GALERÍA DE EVIDENCIA                    */
/* ========================================== */
#preview-gallery {
    width: 100%;
    min-height: 20px;
}

.preview-item {
    position: relative;
    width: 85px;
    height: 85px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    background: #fff;
    padding: 4px;
    overflow: visible;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.btn-remove-file {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
}

.add-image-box {
    width: 85px;
    height: 85px;
    border: 2px dashed var(--verde-institucional);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--verde-institucional);
    background: #f0fdf4;
    transition: all 0.3s ease;
}

.add-image-box:hover {
    background: var(--verde-institucional);
    color: white;
    transform: scale(1.05);
}

.add-image-box i {
    font-size: 1.8rem;
}

.add-image-box span {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 4px;
}

.add-image-box.d-none {
    display: none !important;
}

/* ========================================== */
/* 6. MEDIA QUERIES (TABLETS Y MÓVILES)       */
/* ========================================== */

/* A. TABLETS (601px a 991px) */
@media (max-width: 991px) and (min-width: 601px) {
    /* MÁRGENES IGUALES PARA CENTRAR EL CONTENIDO EN TABLETS */
    .main-content {
        padding-left: 45px; 
        padding-right: 45px; /* <--- ¡AQUÍ ESTÁ LA MAGIA! */
    }
    
    /* Reducir un poco el padding interno de las tarjetas para que el texto quepa mejor */
    .politica-text-col {
        padding: 20px;
    }

    /* Darle más espacio interno a los inputs del formulario */
    .form-card {
        padding: 30px 20px;
    }
    
    /* Ajustar el tamaño del texto de introducción que a veces se ve muy grande */
    .intro-seccion h1 {
        font-size: 2.4em;
    }
}

/* B. MÓVILES (Hasta 600px) */
@media (max-width: 600px) {
    /* Layout General: MÁRGENES IGUALES PARA CENTRAR TODO (EL FIX) */
    .main-content {
        padding-left: 25px; 
        padding-right: 25px;
    }
    
    /* Intro */
    .intro-seccion {
        max-width: 850px;
        margin: 0 auto 50px auto;
        text-align: center;
        padding: 0;
    }
    .intro-seccion h1 { font-size: 2em; }
    
    /* Alineación de la caja de texto */
    .intro-texto { 
        font-size: 1em; 
        padding: 15px; 
        text-align: justify; 
    }

    /* Políticas */
    .politica-container { 
        padding-left: 0; 
        padding-right: 0;
    }
    .politica-punto { 
        flex-direction: row; 
        align-items: center;
        border-left: none; 
        border-radius: 0 15px 15px 0; 
    }
    .politica-punto:hover {
        transform: translateY(-5px); 
        box-shadow: 0 12px 20px rgba(0, 0, 0, 0.12);
    }
    .politica-punto::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 5px; 
        background-color: var(--verde-institucional);
        z-index: 1;
    }
    .politica-left-col { 
        min-width: 85px;       
        padding-left: 15px;    
        background-color: transparent;
        color: var(--verde-institucional);
        height: auto;
    }
    .politica-number { font-size: 2.2em; }
    .icon-badge { 
        left: -21.5px; 
        width: 48px;
        height: 48px;
        border: none; 
    }
    .politica-text-col { 
        padding: 20px 15px 20px 5px; 
    }
    .politica-text {
        font-size: 0.95em; 
    }

    /* Formulario */
    .form-card {
        padding: 25px;
        margin-left: 0; 
        border-left: 5px solid var(--verde-institucional);
    }
    .btn-submit-ambiental { width: 100%; }

    /* Galería en Grid (4 columnas) */
    #preview-gallery {
        display: grid !important; 
        grid-template-columns: repeat(4, 1fr); 
        gap: 8px !important; 
        width: 100%;
    }
    .preview-item, .add-image-box {
        width: 100% !important; 
        height: auto !important;
        aspect-ratio: 1 / 1; 
        margin: 0; 
    }
    .add-image-box i { font-size: 1.2rem; }
    .btn-remove-file {
        width: 20px;
        height: 20px;
        top: -6px;
        right: -6px;
        font-size: 10px;
    }
}

/* C. MÓVILES ULTRA PEQUEÑOS (Hasta 420px) */
/* Ajuste fino del Captcha para celulares ultra pequeños */
@media (max-width: 420px) {
    .mb-3.w-100.d-flex {
        transform: scale(0.85);
        transform-origin: center center;
    }
}

/* ========================================== */
/* 5.1 ESTILOS PARA ADJUNTOS DE DOCUMENTOS    */
/* ========================================== */

/* Contenedor principal de previsualización para documentos */
.document-preview-box {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f1f3f5; /* Un gris claro suave */
    border-radius: 6px;
    color: var(--verde-institucional); /* Color del icono */
    padding: 5px;
}

/* El icono grande de Font Awesome (PDF, Word, etc.) */
.document-preview-box i {
    font-size: 2rem; /* Grande y claro */
    margin-bottom: 3px;
}

/* El nombre del archivo visible y legible */
.document-file-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: #444; /* Contraste prominente */
    text-align: center;
    word-break: break-all; /* Rompe palabras largas */
    overflow: hidden; /* Oculta lo que sobra */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Truncamiento prominente en 2 líneas */
    -webkit-box-orient: vertical;
}