@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #dceef5 0%, #eaf4f8 100%);
    min-height: 100vh;
    padding-bottom: 60px;
}

/* ── Cabecera ───────────────────────────────── */
.cabecera {
    background: linear-gradient(135deg, #0d2b08 0%, #1a5c0f 100%);
    padding: 32px 24px;
    margin-bottom: 32px;
    box-shadow: 0 4px 20px rgba(45, 90, 27, 0.35);
}

.cabecera-interior {
    max-width: 760px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
}

.logo-burbuja {
    width: 100px;
    height: 80px;
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.2);
    padding: 6px;
}

.cabecera-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding-bottom:.2rem ;
}

.cabecera-divisor {
    width: 1px;
    height: 52px;
    background: rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
}

.cabecera-izquierda {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.cabecera-nombre {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    max-width: 178px;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.cabecera-texto {
    flex: 1;
}

.cabecera h1 {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}

.cabecera-subtitulo {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 4px;
}

/* ── Contenedor ─────────────────────────────── */
.contenedor {
    max-width: 760px;
    margin: auto;
    padding: 0 16px;
}

/* ── Sección (tarjeta) ──────────────────────── */
.seccion {
    background: #fff;
    border-radius: 14px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border-left: 4px solid #b22222;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.seccion:hover {
    box-shadow: 0 4px 20px rgba(45, 90, 27, 0.12);
}

.seccion-cabecera {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    background: #f2f7f0;
    border-bottom: 1px solid #dcebd8;
    font-size: 15px;
    font-weight: 700;
    color: #1a3a14;
}

.seccion-cuerpo {
    padding: 24px 28px;
}

.seccion-numero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #1a3a14, #2d6b1a);
    color: #fff;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Campo ──────────────────────────────────── */
.campo {
    margin-bottom: 16px;
}

.campo:last-child {
    margin-bottom: 0;
}

/* ── Fila datos principales ─────────────────── */
.fila-principal {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.bloque-colegiado {
    flex-shrink: 0;
}

.input-con-boton {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.input-con-boton input {
    width: 130px;
}

#btn-clm {
    padding: 10px 14px;
    background: #e5e7eb;
    color: #6b7280;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s, border-color .2s;
}

#btn-clm:hover {
    background: #2d6b1a;
}

#btn-clm.activo {
    background: #1a5c0f;
    border: 1.5px solid #1a5c0f;
    color: #fff;
}

#btn-clm.activo:hover {
    background: #2d6b1a;
}

.separador-vertical {
    width: 1px;
    background: #d1dbd6;
    align-self: stretch;
    flex-shrink: 0;
    margin-bottom: 2px;
}

.bloque-ejerciente {
    flex: 1;
}

.bloque-ejerciente .grupo-opciones {
    margin-top: 0;
}

/* ── Filas en columnas ──────────────────────── */
.fila-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.fila-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.fila-4col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.fila-2col .campo,
.fila-3col .campo,
.fila-4col .campo {
    margin-bottom: 0;
}

/* ── Labels ─────────────────────────────────── */
label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    letter-spacing: 0.1px;
}

/* ── Inputs ─────────────────────────────────── */
input[type="text"],
input[type="tel"],
input[type="email"] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #cdd8d4;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #1f2937;
    background: #f9fbf9;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
}

input[type="text"]::placeholder,
input[type="tel"]::placeholder,
input[type="email"]::placeholder {
    color: #b0b9b4;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus {
    border-color: #2d6b1a;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(45, 107, 26, 0.12);
}

/* ── Opciones radio (Ejerciente) ────────────── */
.grupo-opciones {
    display: flex;
    gap: 12px;
    margin-top: 2px;
}

.opcion {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    background: #f9fbf9;
    border: 1.5px solid #cdd8d4;
    border-radius: 8px;
    padding: 8px 18px;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 0;
}

.opcion:has(input:checked) {
    border-color: #2d6b1a;
    background: #eef5eb;
    color: #1a3a14;
}

.opcion input[type="radio"] {
    accent-color: #2d6b1a;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ── Error en tiempo real ───────────────────── */
.error-campo {
    display: block;
    font-size: 11px;
    color: #dc2626;
    margin-top: 4px;
    min-height: 16px;
}

input.input-error {
    border-color: #dc2626 !important;
    background: #fff5f5 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

/* ── Texto de ayuda bajo el input ──────────── */
.ayuda-campo {
    display: block;
    font-size: 11px;
    color: #6b7a99;
    margin-top: 4px;
    letter-spacing: 0.1px;
}

/* ── Mensaje error servidor ─────────────────── */
.mensaje-error {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #fff5f5;
    border: 1.5px solid #fca5a5;
    border-left: 4px solid #dc2626;
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 32px;
    color: #7f1d1d;
    font-size: 14px;
    animation: fadeIn .4s ease;
}

.mensaje-error-icono {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: #dc2626;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
}

.mensaje-error strong {
    display: block;
    font-size: 15px;
    margin-bottom: 8px;
    color: #b91c1c;
}

.mensaje-error ul {
    margin: 0;
    padding-left: 18px;
}

.mensaje-error li {
    margin-bottom: 4px;
    line-height: 1.5;
}

/* ── Mensaje éxito ──────────────────────────── */
.mensaje-exito {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-left: 4px solid #16a34a;
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 32px;
    color: #14532d;
    font-size: 14px;
    animation: fadeIn .4s ease;
}

.mensaje-exito-icono {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: #16a34a;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
}

.mensaje-exito strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
    color: #15803d;
}

.mensaje-exito p {
    margin: 0;
    color: #166534;
    line-height: 1.5;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Checkbox privacidad ────────────────────── */
.campo-privacidad {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #374151;
    margin-bottom: 16px;
    cursor: pointer;
}

.campo-privacidad input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: #2d6b1a;
    cursor: pointer;
}

/* ── Enlace privacidad ───────────────────────── */
.campo-privacidad a {
    color: #2d6b1a;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.campo-privacidad a:hover {
    color: #1a3a14;
}

/* ── Botón enviar ────────────────────────────── */
button[type="submit"] {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #1a3a14 0%, #2d6b1a 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(45, 90, 27, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
    margin-top: 8px;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(45, 90, 27, 0.4);
}

button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(45, 90, 27, 0.3);
}

/* ── Obligatorio ─────────────────────────────── */
.campo-obligatorio {
    color: #b22222;
    font-weight: 700;
    margin-left: 3px;
}

/* ── Fotografía ─────────────────────────────── */
.foto-fila {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1.5px solid #d1d5db;
    position: relative;
    overflow: visible;
}
.foto-label {
    font-size: 13px;
    font-weight: 600;
    color: #1a3a14;
    background: #f2f7f0;
    padding: 9px 14px;
    border-left: 4px solid #b22222;
    border-right: 1.5px solid #d1d5db;
    border-radius: 6px 0 0 6px;
    white-space: nowrap;
    flex-shrink: 0;
}
.foto-opcional {
    font-size: 11px;
    font-weight: 400;
    color: #9ca3af;
    margin-left: 3px;
}
.foto-nombre {
    flex: 1;
    font-size: 12px;
    color: #9ca3af;
    padding: 9px 12px;
    background: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.foto-btn {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: #2d6b1a;
    padding: 9px 18px;
    cursor: pointer;
    border-left: 1.5px solid #1a5c0f;
    border-radius: 0 6px 6px 0;
    transition: background .2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    overflow: visible;
}
.foto-btn:hover { background: #1a5c0f; }
.foto-preview {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 640px) {
    .cabecera {
        padding: 20px 16px;
    }

    .cabecera h1 {
        font-size: 18px;
    }

    /* La cabecera pasa a apilarse: identidad del colegio arriba, título debajo */
    .cabecera-interior {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
    .logo-burbuja { width: 64px; height: 56px; }
    .cabecera-nombre { max-width: none; }
    .cabecera-subtitulo { font-size: 12px; }

    .seccion-cuerpo {
        padding: 20px 16px;
    }

    .seccion-cabecera {
        padding: 14px 16px;
    }

    .fila-2col,
    .fila-3col,
    .fila-4col {
        grid-template-columns: 1fr;
    }

    /* Datos principales: nº colegiado y "ejerciente" en vertical */
    .fila-principal {
        flex-direction: column;
        gap: 16px;
    }
    .separador-vertical { display: none; }
    .bloque-colegiado,
    .bloque-ejerciente { width: 100%; }
    .input-con-boton { width: 100%; }
    .input-con-boton input { width: auto; flex: 1; }

    /* Opciones (radios) que quepan en pantallas muy estrechas */
    .grupo-opciones { flex-wrap: wrap; }
}
