/* ============================================================
   MN WooEngine – Confirm Payment Form (mnwe-cpf)
   ============================================================ */

.mnwe-cpf-wrap {
    max-width: 680px;
    margin: 0 auto;
    font-family: inherit;
}

/* ── Titles ─────────────────────────────────────────────── */
.mnwe-cpf-title {
    font-size: 1.4em;
    font-weight: 700;
    margin: 0 0 6px;
}
.mnwe-cpf-subtitle {
    color: #666;
    margin: 0 0 20px;
    font-size: 0.95em;
}
.mnwe-cpf-section-title {
    font-size: 1.1em;
    font-weight: 700;
    margin: 24px 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9e9e9;
}

/* ── Form fields ─────────────────────────────────────────── */
.mnwe-cpf-field {
    margin-bottom: 16px;
}
.mnwe-cpf-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.9em;
}
.mnwe-cpf-required {
    color: #e44;
}
.mnwe-cpf-field input[type="text"],
.mnwe-cpf-field input[type="email"],
.mnwe-cpf-field input[type="date"],
.mnwe-cpf-field input[type="time"],
.mnwe-cpf-field textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
    line-height: 1.5;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.mnwe-cpf-field input:focus,
.mnwe-cpf-field textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}
.mnwe-cpf-hint {
    font-size: 0.8em;
    color: #888;
    margin: 4px 0 0;
}

.mnwe-cpf-form-row {
    display: flex;
    gap: 16px;
}
.mnwe-cpf-form-row .mnwe-cpf-field {
    flex: 1;
}

/* ── File upload ─────────────────────────────────────────── */
.mnwe-cpf-upload-wrap {
    position: relative;
}
.mnwe-cpf-field input[type="file"] {
    width: 100%;
    padding: 6px;
    border: 1px dashed #bbb;
    border-radius: 4px;
    box-sizing: border-box;
    cursor: pointer;
    background: #fafafa;
}
.mnwe-cpf-preview {
    margin-top: 10px;
    position: relative;
    display: inline-block;
}
.mnwe-cpf-preview img {
    max-width: 200px;
    max-height: 160px;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: block;
    object-fit: cover;
}
.mnwe-cpf-remove-file {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e44;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 22px;
    text-align: center;
    padding: 0;
}

/* ── Buttons ─────────────────────────────────────────────── */
.mnwe-cpf-btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 4px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s, opacity 0.2s;
    text-decoration: none;
}
.mnwe-cpf-btn--primary {
    background: #2271b1;
    color: #fff;
}
.mnwe-cpf-btn--primary:hover {
    background: #135e96;
}
.mnwe-cpf-btn--secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
}
.mnwe-cpf-btn--secondary:hover {
    background: #e0e0e0;
}
.mnwe-cpf-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mnwe-cpf-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}

/* ── Notices ─────────────────────────────────────────────── */
.mnwe-cpf-notice {
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 0.9em;
    margin-bottom: 14px;
    line-height: 1.5;
}
.mnwe-cpf-notice--error {
    background: #fde8e8;
    border-left: 4px solid #e44;
    color: #a00;
}
.mnwe-cpf-notice--success {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    color: #256029;
}

/* ── Order detail panel ─────────────────────────────────── */
.mnwe-cpf-order-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.mnwe-cpf-order-header h4 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 700;
}
.mnwe-cpf-order-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    background: #e0e0e0;
    color: #333;
}
.mnwe-cpf-status--pending,
.mnwe-cpf-status--on-hold {
    background: #fff3cd;
    color: #856404;
}
.mnwe-cpf-status--processing {
    background: #cce5ff;
    color: #004085;
}
.mnwe-cpf-status--completed {
    background: #d4edda;
    color: #155724;
}
.mnwe-cpf-status--cancelled,
.mnwe-cpf-status--failed,
.mnwe-cpf-status--refunded {
    background: #f8d7da;
    color: #721c24;
}

.mnwe-cpf-order-section {
    margin-bottom: 18px;
}
.mnwe-cpf-order-section h5 {
    font-size: 0.9em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
    margin: 0 0 8px;
}
.mnwe-cpf-order-section p {
    margin: 0 0 4px;
}

/* Items table */
.mnwe-cpf-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}
.mnwe-cpf-items-table th,
.mnwe-cpf-items-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: top;
}
.mnwe-cpf-items-table th {
    font-weight: 700;
    background: #f8f8f8;
    color: #444;
}
.mnwe-cpf-items-table th:last-child,
.mnwe-cpf-items-table td:last-child {
    text-align: right;
}
.mnwe-cpf-row-total td {
    border-top: 2px solid #ddd;
    border-bottom: none;
    padding-top: 10px;
}
.mnwe-cpf-row-discount td {
    color: #e44;
}

.mnwe-cpf-order-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 12px;
}

.mnwe-cpf-shipping-address {
    font-style: normal;
    font-size: 0.88em;
    color: #555;
    line-height: 1.6;
}

/* ── Confirmation wrapper ───────────────────────────────── */
.mnwe-cpf-confirmation-wrap {
    margin-top: 24px;
    padding-top: 4px;
    border-top: 2px solid #e9e9e9;
}

/* ── Success box ────────────────────────────────────────── */
.mnwe-cpf-success-box {
    text-align: center;
    padding: 40px 24px;
    background: #f0faf1;
    border-radius: 8px;
    border: 1px solid #b2dfb4;
}
.mnwe-cpf-success-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #4caf50;
    color: #fff;
    font-size: 28px;
    line-height: 56px;
    margin: 0 auto 16px;
}
.mnwe-cpf-success-box h3 {
    margin: 0 0 10px;
    font-size: 1.3em;
    color: #256029;
}
.mnwe-cpf-success-box p {
    color: #444;
    margin: 0 0 20px;
    font-size: 0.95em;
    line-height: 1.6;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 560px) {
    .mnwe-cpf-form-row {
        flex-direction: column;
        gap: 0;
    }
    .mnwe-cpf-order-meta-grid {
        grid-template-columns: 1fr;
    }
    .mnwe-cpf-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    .mnwe-cpf-btn {
        width: 100%;
        text-align: center;
    }
}
