/* ---------------------------------------------------------------
 * Manos Expertas - estilos compartidos por la aplicacion y el panel
 * ------------------------------------------------------------- */

:root {
    --azul: #0B45D9;
    --azul-oscuro: #0834A8;
    --azul-noche: #0A1F5C;
    --azul-suave: #E7EEFF;
    --fondo: #F2F5FB;
    --blanco: #FFFFFF;
    --texto: #1B2A4A;
    --texto-suave: #5C6984;
    --borde: #DDE4F0;

    --verde: #1B7F45;
    --verde-suave: #DCF5E4;
    --ambar: #7A4D00;
    --ambar-suave: #FFE7A3;
    --rojo: #C22B38;
    --rojo-suave: #FDE4E6;
    --gris: #4B5670;
    --gris-suave: #E6EAF2;

    --radio: 16px;
    --radio-chico: 10px;
    --sombra: 0 2px 10px rgba(16, 42, 110, .08);
    --sombra-alta: 0 12px 32px rgba(16, 42, 110, .16);
    --fuente: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--fuente);
    font-size: 16px;
    line-height: 1.45;
    color: var(--texto);
    background: var(--fondo);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset {
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4 {
    color: var(--azul-noche);
    line-height: 1.2;
}

ul, ol {
    list-style: none;
}

fieldset {
    border: 0;
    min-width: 0;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--azul);
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 3px solid rgba(11, 69, 217, .45);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Iconos */

.icono {
    width: 1.25em;
    height: 1.25em;
    flex: none;
}

/* Logo completo (con nombre y lema). La imagen trae fondo blanco: al multiplicarla con lo que
   tiene detras, ese blanco toma el color del fondo de la pagina y no se ve como un recuadro. */
.logo-completo {
    width: 150px;
    height: auto;
    mix-blend-mode: multiply;
}

/* Ficha blanca con solo el emblema, para tamanos pequenos y fondos oscuros */
.logo-ficha {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: none;
    overflow: hidden;
    border-radius: 12px;
    background: var(--blanco);
}

.logo-ficha img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Botones */

.boton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px;
    border: 2px solid transparent;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, transform .1s;
    -webkit-tap-highlight-color: transparent;
}

.boton:active {
    transform: scale(.98);
}

.boton-primario {
    background: var(--azul);
    color: var(--blanco);
}

.boton-primario:hover {
    background: var(--azul-oscuro);
}

.boton-contorno {
    background: var(--blanco);
    border-color: var(--azul);
    color: var(--azul);
}

.boton-contorno:hover {
    background: var(--azul-suave);
}

.boton-suave {
    background: var(--azul-suave);
    color: var(--azul);
}

.boton-suave:hover {
    background: #D6E2FF;
}

.boton-verde {
    background: var(--verde);
    color: var(--blanco);
}

.boton-verde:hover {
    background: #156737;
}

.boton-peligro {
    background: var(--blanco);
    border-color: var(--rojo);
    color: var(--rojo);
}

.boton-peligro:hover {
    background: var(--rojo-suave);
}

.boton-grande {
    min-height: 52px;
    font-size: 16px;
    border-radius: 14px;
}

.boton-pequeno {
    min-height: 36px;
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 10px;
}

.boton-bloque {
    display: flex;
    width: 100%;
}

.boton-icono {
    padding: 10px;
    aspect-ratio: 1;
}

.boton[aria-disabled="true"],
.boton:disabled {
    opacity: .5;
    pointer-events: none;
}

/* Formularios */

.campo {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.campo > label,
.etiqueta {
    font-weight: 700;
    font-size: 14px;
    color: var(--azul-noche);
}

.campo label small {
    font-weight: 400;
    color: var(--texto-suave);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1.5px solid var(--borde);
    border-radius: 12px;
    background: var(--blanco);
    /* 16px evita que iOS haga zoom al enfocar el campo */
    font-size: 16px;
    transition: border-color .15s, box-shadow .15s;
}

textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.45;
}

select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235C6984' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(11, 69, 217, .15);
}

input:disabled {
    background: var(--gris-suave);
    color: var(--texto-suave);
}

::placeholder {
    color: #8E99B0;
    opacity: 1;
}

.ayuda {
    font-size: 13px;
    color: var(--texto-suave);
}

.campo-error {
    font-size: 13px;
    font-weight: 600;
    color: var(--rojo);
}

.casilla {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    font-weight: 400;
    color: var(--texto);
    cursor: pointer;
}

.casilla input,
input[type="checkbox"],
input[type="radio"] {
    width: 20px;
    height: 20px;
    flex: none;
    margin: 0;
    accent-color: var(--azul);
}

/* Categorias adicionales de la hoja de vida: lista plegable de casillas agrupadas */
.otras-categorias {
    border: 1.5px solid var(--borde);
    border-radius: 12px;
    background: var(--blanco);
}

.otras-categorias summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 48px;
    padding: 11px 40px 11px 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235C6984' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 18px;
    font-size: 16px;
    list-style: none;
    cursor: pointer;
}

.otras-categorias summary::-webkit-details-marker {
    display: none;
}

.otras-categorias[open] summary {
    border-bottom: 1.5px solid var(--borde);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235C6984' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 15 6-6 6 6'/%3E%3C/svg%3E");
}

.otras-categorias summary small {
    color: var(--texto-suave);
    font-size: 13px;
}

.otras-categorias-lista {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 360px;
    padding: 14px;
    overflow-y: auto;
}

.otras-categorias fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.otras-categorias legend {
    padding: 0 0 8px;
    color: var(--texto-suave);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
}

.otras-categorias .casillas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px 12px;
}

.campo-clave {
    position: relative;
}

.campo-clave input {
    padding-right: 52px;
}

.campo-clave button {
    position: absolute;
    top: 0;
    right: 0;
    width: 48px;
    height: 100%;
    display: grid;
    place-items: center;
    border: 0;
    background: none;
    color: var(--texto-suave);
}

/* Insignias de nivel y de estado */

.insignia {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.insignia .icono {
    width: 14px;
    height: 14px;
    stroke-width: 2.4;
}

.insignia-experto,
.estado-pendiente {
    background: var(--ambar-suave);
    color: var(--ambar);
}

.insignia-experiencia,
.estado-aprobado {
    background: var(--verde-suave);
    color: var(--verde);
}

.insignia-nuevo {
    background: var(--azul-suave);
    color: var(--azul);
}

.estado-rechazado {
    background: var(--rojo-suave);
    color: var(--rojo);
}

.estado-suspendido {
    background: var(--gris-suave);
    color: var(--gris);
}

/* Avisos */

.alerta {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
}

.alerta .icono {
    margin-top: 1px;
}

.alerta-ok {
    background: var(--verde-suave);
    color: var(--verde);
}

.alerta-error {
    background: var(--rojo-suave);
    color: var(--rojo);
}

.alerta-info {
    background: var(--azul-suave);
    color: var(--azul-oscuro);
}

/* Foto del profesional */

.avatar {
    width: 56px;
    height: 56px;
    flex: none;
    border-radius: 14px;
    object-fit: cover;
    background: var(--azul-suave);
}

.avatar-iniciales,
.avatar-vacio {
    display: grid;
    place-items: center;
    color: var(--azul);
    font-weight: 800;
    font-size: 20px;
    letter-spacing: .5px;
}

.avatar-vacio .icono {
    width: 45%;
    height: 45%;
}

.avatar-perfil {
    width: 124px;
    height: 124px;
    border-radius: 22px;
    font-size: 40px;
}

/* Formulario de hoja de vida (aplicacion y panel) */

.formulario {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.grupo {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    border-radius: var(--radio);
    background: var(--blanco);
    box-shadow: var(--sombra);
}

.grupo > h3 {
    font-size: 17px;
}

.grupo > .boton {
    align-self: flex-start;
}

.foto-selector {
    display: flex;
    align-items: center;
    gap: 16px;
}

.foto-selector .avatar-perfil {
    width: 96px;
    height: 96px;
}

.foto-selector .ayuda {
    margin-top: 8px;
}

.fotos-actuales,
.fotos-nuevas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px;
}

.fotos-nuevas:empty {
    display: none;
}

.foto-actual {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

.foto-actual img,
.fotos-nuevas img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    object-fit: cover;
}

.foto-actual span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.foto-actual input {
    width: 18px;
    height: 18px;
}

/* Sellos de confianza, estrellas y calificacion */

.sello-identidad {
    background: var(--verde-suave);
    color: var(--verde);
}

.sello-certificado {
    background: #E9E4FB;
    color: #5B21B6;
}

.estrellas {
    display: inline-flex;
    gap: 1px;
    color: #C9D1E0;
    vertical-align: middle;
}

.estrellas .icono {
    width: 16px;
    height: 16px;
}

.estrellas .llena,
.calificacion .llena {
    color: #E0A100;
    fill: currentColor;
}

.calificacion {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--texto-suave);
    font-size: 13.5px;
    white-space: nowrap;
}

.calificacion .icono {
    width: 15px;
    height: 15px;
}

.calificacion strong {
    color: var(--azul-noche);
}

.texto-suave {
    color: var(--texto-suave);
    font-size: 14.5px;
}

/* Requisitos para subir de nivel: cumplido o pendiente */

.requisitos {
    display: grid;
    gap: 7px;
}

.requisitos li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14.5px;
}

.requisitos .icono {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    stroke-width: 2.4;
}

.requisitos .cumple .icono {
    color: var(--verde);
}

.requisitos .falta {
    color: var(--texto-suave);
}

.requisitos .falta .icono {
    color: #C28A00;
}

/* Documentos privados dentro del formulario de hoja de vida */

.aviso-privado {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--azul-suave);
    color: var(--azul-oscuro);
    font-size: 13.5px;
}

.aviso-privado .icono {
    width: 17px;
    height: 17px;
    margin-top: 1px;
}

.archivo-actual,
.lista-archivos li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
}

.archivo-actual .icono,
.lista-archivos .icono {
    color: var(--azul);
}

.archivo-actual a,
.lista-archivos a {
    font-weight: 700;
}

.lista-archivos {
    display: grid;
    gap: 10px;
}

.lista-archivos a {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.archivo-elegido {
    color: var(--verde);
    font-size: 13.5px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.archivo-elegido:empty {
    display: none;
}

/* minmax(0, 1fr) impide que el campo de archivo, que es ancho por naturaleza, desborde la caja en celular */
.certificado-nuevo {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    border: 1.5px dashed var(--borde);
    border-radius: 12px;
}

/* Los campos de archivo ocultos (.sr-only) se abren desde su boton: si tomaran el 100% del ancho,
   al estar fuera del flujo empujarian la pagina hacia la derecha y apareceria desplazamiento horizontal */
input[type="file"]:not(.sr-only) {
    width: 100%;
    font-size: 14px;
}

.campo > .boton {
    align-self: flex-start;
}

/* Historial de cambios (niveles, casos) */

.historial {
    display: grid;
    gap: 10px;
}

.historial li {
    padding-left: 12px;
    border-left: 3px solid var(--azul-suave);
    font-size: 14.5px;
}

.historial small {
    display: block;
    color: var(--texto-suave);
    font-size: 13px;
}

/* Aviso breve que aparece y se va solo */

.aviso-flotante {
    position: fixed;
    right: 16px;
    bottom: 96px;
    left: 16px;
    z-index: 110;
    max-width: 420px;
    margin: 0 auto;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--azul-noche);
    color: var(--blanco);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    box-shadow: var(--sombra-alta);
}
