/* =============================================================
   Pago Móvil para Tutor LMS — Modal styles
   ============================================================= */

/* Overlay */
#pm-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

#pm-modal[style*="display: block"],
#pm-modal[style*="display:block"] {
    display: flex !important;
}

.pm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}

/* Cuadro del modal */
.pm-dialog {
    position: relative;
    background: #ffffff;
    border-radius: 14px;
    width: 100%;
    max-width: 500px;
    margin: 16px;
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    animation: pm-slide-in 0.22s ease;
}

@keyframes pm-slide-in {
    from { opacity: 0; transform: translateY(-18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Header */
.pm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

.pm-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.3;
}

.pm-icon {
    font-size: 20px;
}

.pm-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    font-size: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.pm-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Body */
.pm-body {
    padding: 22px 24px 18px;
}

.pm-desc {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 18px;
    line-height: 1.5;
}

/* Campos */
.pm-field {
    margin-bottom: 16px;
}

.pm-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.pm-req {
    color: #ef4444;
}

.pm-hint {
    font-weight: 400;
    color: #9ca3af;
    font-size: 12px;
}

.pm-field input,
.pm-field select {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.18s, box-shadow 0.18s;
    -webkit-appearance: none;
    appearance: none;
}

.pm-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.pm-field input:focus,
.pm-field select:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.pm-field input[readonly] {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
    border-style: dashed;
}

.pm-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.10) !important;
}

.pm-err {
    display: block;
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
}

/* Footer */
.pm-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 14px 24px 20px;
    border-top: 1px solid #f3f4f6;
}

.pm-btn {
    padding: 10px 22px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, transform 0.1s;
    line-height: 1;
}

.pm-btn:active {
    transform: scale(0.97);
}

.pm-btn-primary {
    background: #7c3aed;
    color: #ffffff;
}

.pm-btn-primary:hover {
    background: #6d28d9;
}

.pm-btn-cancel {
    background: #f3f4f6;
    color: #4b5563;
}

.pm-btn-cancel:hover {
    background: #e5e7eb;
}

/* Bloquear scroll del body mientras el modal está abierto */
body.pm-overflow-hidden {
    overflow: hidden;
}

/* =============================================================
   Badge de confirmación (aparece debajo del método de pago)
   ============================================================= */
.pm-badge {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding: 10px 14px;
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: 8px;
    font-size: 13px;
    color: #166534;
    line-height: 1.4;
}

.pm-badge-check {
    font-size: 15px;
    color: #16a34a;
    flex-shrink: 0;
}

.pm-badge-text {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.pm-badge-edit {
    background: none;
    border: 1px solid #86efac;
    color: #15803d;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 5px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.pm-badge-edit:hover {
    background: #dcfce7;
    color: #14532d;
}

/* Responsive */
@media (max-width: 540px) {
    .pm-dialog {
        border-radius: 14px 14px 0 0;
        margin: 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
    }

    .pm-header {
        padding: 16px 18px 14px;
    }

    .pm-body {
        padding: 18px 18px 14px;
        max-height: 60vh;
        overflow-y: auto;
    }

    .pm-footer {
        padding: 12px 18px 18px;
    }

    .pm-btn {
        flex: 1;
        text-align: center;
    }
}
