/* ================================================================
   Profile Widget — Password Reset Modal
   ================================================================ */

/* Overlay */
.nm-pwreset-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.35s, visibility 0.35s;
}

.nm-pwreset-modal.active {
    opacity: 1;
    pointer-events: all;
    visibility: visible;
}

/* Box */
.nm-pwreset-modal-box {
    background: #fff;
    border-radius: 16px;
    box-shadow:
        0px 11px 15px -7px rgba(0, 0, 0, 0.2),
        0px 24px 38px  3px rgba(0, 0, 0, 0.14),
        0px  9px 46px  8px rgba(0, 0, 0, 0.12);
    width: 440px;
    max-width: 92vw;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    transform: translateY(-12px);
    transition: transform 0.35s;
}

.nm-pwreset-modal.active .nm-pwreset-modal-box {
    transform: translateY(0);
}

/* Title bar */
.nm-pwreset-modal-title {
    position: relative;
    background: #000;
    border-radius: 16px 16px 0 0;
    color: #fff;
    padding: 12px 24px;
    font-size: 20px;
    display: flex;
    align-items: center;
}

.nm-pwreset-modal-title p {
    margin: 0;
    flex: 1;
}

/* Close button */
.nm-pwreset-modal-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    background-color: grey;
    -webkit-mask-image: url('../product/assets/close.svg');
            mask-image: url('../product/assets/close.svg');
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
    -webkit-mask-position: center;
            mask-position: center;
    -webkit-mask-size: 24px 24px;
            mask-size: 24px 24px;
    transition: background-color 0.2s;
}

.nm-pwreset-modal-close:hover {
    background-color: #fff;
}

/* Body */
.nm-pwreset-modal-body {
    padding: 24px 32px 0;
}

.nm-pwreset-modal-body p {
    margin: 0 0 12px;
    font-size: 15px;
    color: #333;
    line-height: 1.55;
}

.nm-pwreset-modal-hint {
    font-size: 13px !important;
    color: #666 !important;
}

.nm-pwreset-modal-error {
    font-size: 13px !important;
    color: #dc3545 !important;
}

/* Actions */
.nm-pwreset-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 32px 24px;
}

.nm-pwreset-modal-cancel {
    font-size: 14px;
    font-weight: 400;
    font-family: 'Montserrat', sans-serif;
    border-radius: 4px;
    cursor: pointer;
    padding: 10px 24px;
    border: 1px solid #ccc;
    background: transparent;
    color: #555;
    transition: background 0.25s, color 0.25s;
}

.nm-pwreset-modal-cancel:hover {
    background: #f0f0f0;
}

.nm-pwreset-modal-confirm {
    font-size: 14px;
    font-weight: 400;
    font-family: 'Montserrat', sans-serif;
    border-radius: 4px;
    cursor: pointer;
    padding: 10px 28px;
    border: none;
    background-color: #555;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: background 0.25s, box-shadow 0.25s;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.nm-pwreset-modal-confirm:hover:not(:disabled) {
    background-color: #333;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.nm-pwreset-modal-confirm:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Spinner inside confirm button */
.nm-pwreset-btn-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: nm-pwreset-spin 0.7s linear infinite;
}

.nm-pwreset-modal-confirm.is-loading .nm-pwreset-btn-spinner {
    display: inline-block;
}

@keyframes nm-pwreset-spin {
    to { transform: rotate(360deg); }
}

/* ── Password field row in profile form ── */
.profile-widget .profile-field--password {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-widget .field-password-placeholder {
    flex: 1;
    letter-spacing: 3px;
    color: #aaa;
    font-size: 14px;
    border-bottom: 1px solid transparent;
    padding: 4px 0;
}

/* Reset-trigger button — hidden until edit mode */
.profile-widget .password-reset-trigger {
    display: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.45;
    transition: opacity 0.2s;
}

.profile-widget .password-reset-trigger:hover {
    opacity: 1;
}

.profile-widget .password-reset-trigger img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    /* Tint to grey to match Editar button */
    filter: grayscale(1) brightness(0.55);
}

.profile-widget.is-editing .password-reset-trigger {
    display: inline-flex;
}
