/* =========================
   FORMULARIO BONOS - PASO 1
   Resolución de Catastro
========================= */

.meag-form {
    max-width: 1200px;
    margin: 40px auto;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* TITLES */
.meag-form-title-main {
    text-align: left;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 5px;
    color: #0f172a;
}

.meag-form-subtitle {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 30px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 15px;
}

/* =========================
   STEPS (Círculos numerados)
========================= */

.meag-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    gap: 15px;
}

.meag-step {
    display: flex;
    align-items: center;
    gap: 15px;
}

.meag-step-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid #0051a8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #0051a8;
    background: #fff;
    font-size: 18px;
}

.meag-step--active .meag-step-circle {
    background: #0051a8;
    color: #fff;
}

.meag-step-line {
    width: 60px;
    height: 3px;
    background: #cbd5e1;
}

/* =========================
   TITULO
========================= */

.meag-form-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    margin: 10px 0 40px;
    color: #333;
}

/* =========================
   SECCIONES
========================= */

.meag-section {
    background: #eef5ff;
    padding: 30px;
    border-radius: 14px;
    margin-bottom: 30px;
}

.meag-section h3 {
    margin: 0 0 5px;
    font-size: 20px;
    font-weight: 600;
    color: #334155;
}

.meag-help {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 25px;
}

/* =========================
   CAMPOS Y GRID
========================= */

.meag-field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.meag-field-row.full-width {
    grid-template-columns: 1fr;
}

.meag-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meag-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
}

.meag-file-wrapper {
    display: flex;
}

.meag-file-wrapper input[type=file] {
    flex: 1;
}

.meag-field input[type="text"],
.meag-field input[type="date"],
.meag-field select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #b1bbc9;
    /* Un poco más oscuro que #cbd5e1 para asegurar visibilidad */
    background: #ffffff;
    box-sizing: border-box !important;
    transition: all 0.2s ease;
    color: #333;
}

.meag-field input::placeholder {
    color: #94a3b8;
}

/* Selector de Archivos Personalizado */
.meag-field input[type="file"] {
    width: 100%;
    height: 42px;
    padding: 0;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #b1bbc9;
    /* Un poco más oscuro */
    background: #ffffff;
    box-sizing: border-box !important;
    transition: all 0.2s ease;
    cursor: pointer;
    line-height: 40px;
}

.meag-field input[type="file"]::-webkit-file-upload-button,
.meag-field input[type="file"]::file-selector-button {
    background: #0051a8;
    color: #ffffff;
    border: none;
    height: 100%;
    padding: 0 16px;
    margin-right: 15px;
    border-radius: 5px 0 0 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.2s;
}

.meag-field input[type="file"]::-webkit-file-upload-button:hover,
.meag-field input[type="file"]::file-selector-button:hover {
    background: #003d7e;
}

.meag-field--select-small {
    max-width: 280px;
}

.meag-field input:focus,
.meag-field select:focus {
    outline: none;
    border-color: #0051a8;
    box-shadow: 0 0 0 3px rgba(0, 81, 168, 0.15);
}

/* =========================
   TAGS / CHIPS
========================= */

.meag-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.meag-tag {
    background: #e8f1ff;
    border: 1px solid #2f6fdf;
    color: #2f6fdf;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.meag-tag span {
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

/* =========================
   BOTON PRINCIPAL
========================= */

.meag-action-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.meag-btn-secondary {
    background: #ffffff;
    color: #0051a8;
    border: 1px solid #0051a8;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.meag-btn-secondary:hover {
    background: rgba(0, 81, 168, 0.05);
}

/* =========================
   TABLA
========================= */

.meag-table-container {
    margin-top: 40px;
}

.meag-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.meag-table thead {
    background: #0051a8;
    color: #ffffff;
}

.meag-table th {
    padding: 12px;
    font-weight: 600;
    text-align: left;
}

.meag-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
}

.meag-table .meag-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.meag-table .meag-actions .dashicons {
    cursor: pointer;
    font-size: 20px;
    color: #0051a8;
    transition: color 0.2s;
    text-decoration: none;
    width: 20px;
    height: 20px;
}

.meag-table .meag-actions a {
    text-decoration: none;
    display: inline-block;
}

.meag-table .meag-actions .dashicons:hover {
    color: #003d7e;
}

.meag-table .meag-actions .dashicons-trash:hover {
    color: #cc0000;
}

/* =========================
   FOOTER BUTTONS STANDARD
========================= */
.meag-form-footer {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 15px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.meag-btn-primary {
    background: #0051a8 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 10px 22px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
}

.meag-btn-primary:hover {
    background: #003d7e !important;
}

/* =========================
   AGRUPACIÓN DE COMUNAS
   ========================= */
.meag-region-group {
    margin-top: 15px;
    width: 100%;
}

.meag-region-group-title {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #0051a8 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e2e8f0;
    font-family: inherit !important;
}

.meag-region-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
