/* Cambio de contraseña obligatorio en el primer ingreso (2026-10-15). Estándar de modales: overlay
   oscuro, header #2C4596, body blanco, footer con Cancelar gris y acción verde. */

.fpc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 16, 36, 0.62);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.fpc-modal {
    background: #fff;
    border-radius: 16px;
    width: 468px;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(6, 12, 32, 0.45);
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
    color: #1f2433;
    text-align: left;
    animation: fpc-entrar 0.22s ease-out;
}

.fpc-modal svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

#fpcPaso {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Encabezado */
.fpc-header {
    background: #2C4596;
    padding: 20px 26px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.fpc-header-ico {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fpc-header-ico svg {
    width: 22px;
    height: 22px;
}

.fpc-titulo {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.2px;
}

.fpc-subtitulo {
    margin: 2px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.82);
}

/* Cuerpo */
.fpc-body {
    padding: 20px 26px 4px;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.fpc-usuario {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    background: #f4f6fb;
    border-radius: 12px;
}

.fpc-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #2C4596;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fpc-usuario-datos {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex-grow: 1;
}

.fpc-usuario-nombre {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fpc-usuario-login {
    font-size: 12px;
    color: #5b6272;
}

.fpc-etiqueta {
    font-size: 11px;
    font-weight: 700;
    color: #8a4b08;
    background: #fdefd6;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.fpc-intro {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #4a5163;
}

/* Campos */
.fpc-campo {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.fpc-label {
    font-size: 13px;
    font-weight: 700;
    color: #1f2433;
}

.fpc-input {
    position: relative;
}

.fpc-input-ico {
    position: absolute;
    left: 13px;
    top: 13px;
    color: #7a8294;
    display: flex;
}

.fpc-input input {
    width: 100%;
    box-sizing: border-box;
    height: 44px;
    padding: 0 46px 0 40px;
    border: 1.5px solid #d3d8e2;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    color: #1f2433;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.fpc-input input::placeholder {
    color: #9aa1ae;
}

.fpc-input input:focus {
    outline: none;
    border-color: #2C4596;
    box-shadow: 0 0 0 4px rgba(44, 69, 150, 0.14);
}

.fpc-input-ok input {
    border-color: #3f8f2a;
}

.fpc-input-mal input {
    border-color: #d64545;
}

.fpc-ver {
    position: absolute;
    top: 0;
    right: 2px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    color: #5b6272;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.fpc-ver:hover {
    color: #2C4596;
}

.fpc-ver:focus-visible,
.fpc-cancelar:focus-visible,
.fpc-guardar:focus-visible {
    outline: 3px solid rgba(44, 69, 150, 0.45);
    outline-offset: 2px;
}

/* Fuerza */
.fpc-fuerza {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: -6px;
}

.fpc-barras {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    flex-grow: 1;
}

.fpc-barras span {
    height: 6px;
    border-radius: 3px;
    background: #e4e7ee;
    transition: background 0.2s;
}

.fpc-n1 .fpc-on { background: #c2410c; }
.fpc-n2 .fpc-on { background: #b7791f; }
.fpc-n3 .fpc-on { background: #2C4596; }
.fpc-n4 .fpc-on { background: #3f8f2a; }

.fpc-fuerza-texto {
    min-width: 54px;
    text-align: right;
    font-size: 12px;
    font-weight: 700;
}

.fpc-fuerza-texto.fpc-n1 { color: #c2410c; }
.fpc-fuerza-texto.fpc-n2 { color: #94600f; }
.fpc-fuerza-texto.fpc-n3 { color: #2C4596; }
.fpc-fuerza-texto.fpc-n4 { color: #2f6b1e; }

/* Requisitos */
.fpc-reqs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 14px;
}

.fpc-reqs li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: #5b6272;
}

.fpc-reqs li svg {
    width: 16px;
    height: 16px;
}

.fpc-req-pend { color: #b5bbc7; }
.fpc-req-ok { color: #3f8f2a; display: none; }
.fpc-reqs li.fpc-ok { color: #2f6b1e; }
.fpc-reqs li.fpc-ok .fpc-req-ok { display: block; }
.fpc-reqs li.fpc-ok .fpc-req-pend { display: none; }

/* Coincidencia */
.fpc-coincide {
    display: none;
    align-items: center;
    gap: 6px;
    margin-top: -6px;
    font-size: 12.5px;
    font-weight: 700;
}

.fpc-coincide svg {
    width: 15px;
    height: 15px;
}

.fpc-coincide.fpc-si { display: flex; color: #2f6b1e; }
.fpc-coincide.fpc-no { display: flex; color: #b42318; }

/* Consejo y error */
.fpc-tip {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 11px 13px;
    background: #eef3ff;
    border-radius: 10px;
    font-size: 12.5px;
    line-height: 1.5;
    color: #2a3a6e;
}

.fpc-tip svg {
    width: 16px;
    height: 16px;
    margin-top: 1px;
    color: #2C4596;
}

.fpc-error {
    display: none;
    padding: 9px 12px;
    border-radius: 8px;
    background: #fdecea;
    color: #b42318;
    font-size: 13px;
}

/* Pie */
.fpc-footer {
    margin-top: 14px;
    padding: 14px 26px;
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
}

.fpc-footer-centro {
    justify-content: center;
}

.fpc-cancelar,
.fpc-guardar {
    height: 40px;
    padding: 0 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
}

.fpc-cancelar {
    background: #e0e0e0;
    color: #333;
    font-weight: 600;
}

.fpc-cancelar:hover {
    background: #d4d4d4;
}

.fpc-guardar {
    background: #61a541;
    color: #fff;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.15s, background 0.15s;
}

.fpc-guardar:hover:not(:disabled) {
    background: #56933a;
}

.fpc-guardar svg {
    width: 16px;
    height: 16px;
}

.fpc-guardar:disabled {
    opacity: 0.55;
    cursor: default;
}

.fpc-guardar.fpc-cargando svg {
    display: none;
}

/* Contraseña guardada */
.fpc-exito {
    align-items: center;
    text-align: center;
    padding: 36px 34px 26px;
    gap: 12px;
}

.fpc-exito-halo {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: #e8f4e2;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fpc-pop 0.35s ease-out;
}

.fpc-exito-check {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #3f8f2a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fpc-exito-check svg {
    width: 30px;
    height: 30px;
    stroke-width: 3;
}

.fpc-exito-titulo {
    margin: 6px 0 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.3px;
    outline: none;
}

.fpc-exito-texto {
    margin: 0;
    max-width: 330px;
    font-size: 14px;
    line-height: 1.55;
    color: #4a5163;
}

.fpc-progreso {
    width: 100%;
    height: 6px;
    margin-top: 10px;
    border-radius: 3px;
    background: #e4e7ee;
    overflow: hidden;
}

.fpc-progreso span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 3px;
    background: #2C4596;
    animation: fpc-avance linear forwards;
}

.fpc-progreso-texto {
    font-size: 12.5px;
    color: #5b6272;
}

.fpc-exito .fpc-tip {
    width: 100%;
    box-sizing: border-box;
    align-items: center;
    text-align: left;
    margin-top: 4px;
}

@keyframes fpc-entrar {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

@keyframes fpc-pop {
    from { transform: scale(0.6); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes fpc-avance {
    from { width: 0; }
    to { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .fpc-modal,
    .fpc-exito-halo { animation: none; }
}

@media (max-width: 460px) {
    .fpc-header,
    .fpc-body,
    .fpc-footer { padding-left: 18px; padding-right: 18px; }
    .fpc-reqs { grid-template-columns: 1fr; }
    .fpc-etiqueta { display: none; }
}
