/* ============================================================
   Buzón de Mensajes Ciudadano — Estilo público
   Diseño moderno, institucional y elegante.
   ============================================================ */

:root {
    --bmc-accent:        #c8102e;
    --bmc-accent-dark:   #8a0a1f;
    --bmc-accent-soft:   rgba(200, 16, 46, .08);
    --bmc-bg:            #f7f8fa;
    --bmc-card:          #ffffff;
    --bmc-ink:           #0f172a;
    --bmc-ink-2:         #334155;
    --bmc-muted:         #64748b;
    --bmc-muted-2:       #94a3b8;
    --bmc-line:          #e5e9f0;
    --bmc-line-2:        #eef1f6;
    --bmc-radius:        14px;
    --bmc-radius-sm:     10px;
    --bmc-shadow-sm:     0 1px 2px rgba(15, 23, 42, .04);
    --bmc-shadow:        0 10px 30px -10px rgba(15, 23, 42, .15), 0 4px 12px -6px rgba(15, 23, 42, .08);
    --bmc-font:          -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ----------- Contenedor general ----------- */
.bmc-form-wrapper {
    position: relative;
    max-width: 1080px;
    margin: 32px auto;
    padding: 0;
    color: var(--bmc-ink);
    font-family: var(--bmc-font);
    line-height: 1.55;
    box-sizing: border-box;
    isolation: isolate;
}
.bmc-form-wrapper * { box-sizing: border-box; }

/* Fondo decorativo */
.bmc-form-wrapper::before {
    content: "";
    position: absolute;
    inset: -20px -20px auto -20px;
    height: 320px;
    z-index: -2;
    background:
        radial-gradient(60% 80% at 80% 0%, var(--bmc-accent-soft) 0%, transparent 60%),
        linear-gradient(180deg, #ffffff 0%, var(--bmc-bg) 100%);
    border-radius: 24px;
}

.bmc-form-wrapper.bmc-has-dots::after {
    content: "";
    position: absolute;
    top: 36px;
    right: 24px;
    width: 220px;
    height: 220px;
    pointer-events: none;
    z-index: -1;
    opacity: .35;
    background-image: radial-gradient(rgba(15, 23, 42, .25) 1.2px, transparent 1.4px);
    background-size: 14px 14px;
    -webkit-mask-image: radial-gradient(closest-side, #000 60%, transparent 100%);
            mask-image: radial-gradient(closest-side, #000 60%, transparent 100%);
}

/* ----------- Encabezado ----------- */
.bmc-form-header {
    text-align: center;
    padding: 56px 24px 28px;
}
.bmc-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    font-size: 11px;
    letter-spacing: .26em;
    text-transform: uppercase;
    color: var(--bmc-accent);
    font-weight: 700;
}
.bmc-eyebrow::before,
.bmc-eyebrow::after {
    content: "";
    width: 28px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--bmc-accent));
    opacity: .6;
}
.bmc-eyebrow::after { background: linear-gradient(90deg, var(--bmc-accent), transparent); }

.bmc-title {
    margin: 0 0 14px;
    font-size: clamp( 28px, 4vw, 40px );
    line-height: 1.1;
    font-weight: 800;
    color: var(--bmc-ink);
    letter-spacing: -0.02em;
}
.bmc-subtitle {
    margin: 0 auto;
    max-width: 640px;
    color: var(--bmc-muted);
    font-size: 16px;
}

/* ----------- Tarjeta del formulario ----------- */
.bmc-form {
    position: relative;
    background: var(--bmc-card);
    border: 1px solid var(--bmc-line);
    border-radius: var(--bmc-radius);
    padding: 32px;
    margin: 8px 8px 24px;
    box-shadow: var(--bmc-shadow);
}
.bmc-form::before {
    content: "";
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 3px;
    background: linear-gradient(90deg, var(--bmc-accent) 0%, var(--bmc-accent-dark) 60%, transparent 100%);
    border-radius: 3px;
}

/* ----------- Grid ----------- */
.bmc-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.bmc-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 16px;
}
.bmc-field { display: flex; flex-direction: column; position: relative; }
.bmc-field-full { grid-column: 1 / -1; }

.bmc-field label {
    font-size: 12.5px;
    color: var(--bmc-ink-2);
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: .01em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.bmc-req { color: var(--bmc-accent); font-weight: 700; }

/* ----------- Inputs ----------- */
.bmc-field input[type="text"],
.bmc-field input[type="email"],
.bmc-field input[type="tel"],
.bmc-field input[type="number"],
.bmc-field input[type="url"],
.bmc-field select,
.bmc-field textarea {
    width: 100%;
    background: #fbfcfe;
    border: 1.5px solid var(--bmc-line);
    border-radius: var(--bmc-radius-sm);
    padding: 13px 16px;
    font-size: 15px;
    color: var(--bmc-ink);
    box-shadow: var(--bmc-shadow-sm);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
    font-family: inherit;
}

.bmc-field textarea {
    resize: vertical;
    min-height: 180px;
    line-height: 1.55;
}
.bmc-field input::placeholder,
.bmc-field textarea::placeholder {
    color: var(--bmc-muted-2);
    font-weight: 400;
}

.bmc-field input:hover,
.bmc-field select:hover,
.bmc-field textarea:hover {
    border-color: #d4d9e2;
    background: #ffffff;
}

.bmc-field input:focus,
.bmc-field select:focus,
.bmc-field textarea:focus {
    outline: none;
    border-color: var(--bmc-accent);
    background: #ffffff;
    box-shadow: 0 0 0 4px var(--bmc-accent-soft);
}

.bmc-field select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'><path d='M5.5 7.5l4.5 5 4.5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    padding-right: 42px;
    cursor: pointer;
}

.bmc-field.has-error input,
.bmc-field.has-error select,
.bmc-field.has-error textarea {
    border-color: var(--bmc-accent);
    background: #fff5f6;
}

.bmc-error {
    color: var(--bmc-accent);
    font-size: 12px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.bmc-error::before {
    content: "";
    display: inline-block;
    width: 14px; height: 14px;
    background: var(--bmc-accent);
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm-1 5h2v6h-2V7zm0 8h2v2h-2v-2z'/></svg>") center/contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm-1 5h2v6h-2V7zm0 8h2v2h-2v-2z'/></svg>") center/contain no-repeat;
}

/* ----------- Checkbox de aceptación ----------- */
.bmc-check {
    margin-top: 4px;
    padding: 16px 18px;
    background: #f8fafc;
    border: 1px solid var(--bmc-line);
    border-radius: var(--bmc-radius-sm);
}
.bmc-check label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-weight: 400;
    color: var(--bmc-ink-2);
    font-size: 13.5px;
    margin: 0;
    cursor: pointer;
    line-height: 1.55;
}
.bmc-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
    border: 1.5px solid var(--bmc-line);
    background: #ffffff;
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    transition: all .15s ease;
}
.bmc-check input[type="checkbox"]:hover { border-color: var(--bmc-accent); }
.bmc-check input[type="checkbox"]:checked {
    background: var(--bmc-accent);
    border-color: var(--bmc-accent);
}
.bmc-check input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M9 16.2l-3.5-3.5L4 14.2 9 19.2l11-11-1.4-1.4z'/></svg>") center/14px no-repeat;
}
.bmc-check input[type="checkbox"]:focus-visible {
    outline: 3px solid var(--bmc-accent-soft);
    outline-offset: 1px;
}
.bmc-check a { color: var(--bmc-accent); text-decoration: underline; font-weight: 600; }

/* ----------- Botón ----------- */
.bmc-actions {
    margin-top: 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.bmc-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 999px;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .08s ease, box-shadow .18s ease;
    font-family: inherit;
    box-shadow: 0 2px 0 rgba(15, 23, 42, .03);
}
.bmc-btn::after {
    content: "";
    width: 16px; height: 16px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M5 12h12l-4-4 1.4-1.4L20.8 12l-6.4 5.4L13 16l4-4H5z'/></svg>") center/contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M5 12h12l-4-4 1.4-1.4L20.8 12l-6.4 5.4L13 16l4-4H5z'/></svg>") center/contain no-repeat;
    transition: transform .18s ease;
}
.bmc-btn:hover::after { transform: translateX(4px); }
.bmc-btn:hover { box-shadow: 0 10px 24px -10px rgba(200, 16, 46, .45); }
.bmc-btn:active { transform: translateY(1px); }
.bmc-btn:focus-visible { outline: 3px solid var(--bmc-accent-soft); outline-offset: 2px; }

.bmc-actions-hint { color: var(--bmc-muted); font-size: 12.5px; }
.bmc-actions-hint .bmc-req { color: var(--bmc-accent); }

/* ----------- Alertas ----------- */
.bmc-alert {
    position: relative;
    border-radius: var(--bmc-radius-sm);
    padding: 14px 16px 14px 48px;
    margin: 0 8px 16px;
    font-size: 14px;
    line-height: 1.5;
}
.bmc-alert::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
}
.bmc-alert ul { margin: 6px 0 0 18px; padding: 0; }

.bmc-alert-success {
    background: linear-gradient(180deg, #ecfdf5 0%, #f0fdf4 100%);
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.bmc-alert-success::before {
    background: #10b981 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M9 16.2l-3.5-3.5L4 14.2 9 19.2l11-11-1.4-1.4z'/></svg>") center/14px no-repeat;
}

.bmc-alert-error {
    background: linear-gradient(180deg, #fef2f2 0%, #fff5f5 100%);
    color: #7f1d1d;
    border: 1px solid #fecaca;
}
.bmc-alert-error::before {
    background: var(--bmc-accent) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm-1 5h2v6h-2V7zm0 8h2v2h-2v-2z'/></svg>") center/14px no-repeat;
}

/* Honeypot oculto */
.bmc-hp { position: absolute; left: -9999px; top: -9999px; height: 0; width: 0; overflow: hidden; }

/* ----------- Responsive ----------- */
@media (max-width: 760px) {
    .bmc-form-wrapper { margin: 16px auto; }
    .bmc-form-header { padding: 36px 18px 20px; }
    .bmc-form { padding: 22px 18px; margin: 8px 12px 16px; border-radius: 12px; }
    .bmc-form::before { left: 16px; right: 16px; }
    .bmc-title { font-size: 26px; }
    .bmc-row, .bmc-fields-grid { grid-template-columns: 1fr; gap: 14px; }
    .bmc-form-wrapper.bmc-has-dots::after { width: 130px; height: 130px; opacity: .25; }
    .bmc-actions { flex-direction: column; align-items: stretch; }
    .bmc-btn { justify-content: center; }
}
