/* ===== Trigger button ===== */
.mtb-button-wrap {
    margin: 12px 0 4px;
}
.mtb-button-wrap .mtb-open-modal {
    background: #3D3C6C !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer;
    border: none;
    width: 100%;
    transition: background .15s ease;
}
.mtb-button-wrap .mtb-open-modal:hover {
    background: #2a2a5a !important;
}
.mtb-button-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
}

/* ===== Modal ===== */
.mtb-modal {
    position: fixed; inset: 0;
    z-index: 99999;
    display: none;
    align-items: center; justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}
.mtb-modal.mtb-open { display: flex; }
.mtb-modal-overlay {
    position: absolute; inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}
.mtb-modal-dialog {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 540px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 28px 28px 24px;
    z-index: 1;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.mtb-modal-close {
    position: absolute; top: 8px; right: 12px;
    background: transparent; border: none;
    font-size: 28px; line-height: 1;
    color: #6b7280; cursor: pointer;
}
.mtb-modal-close:hover { color: #1f2937; }

.mtb-modal-header h3 {
    margin: 0 0 6px;
    font-size: 20px;
    color: #1f2937;
    font-weight: 700;
}
.mtb-modal-header p {
    margin: 0 0 18px;
    font-size: 13.5px;
    color: #6b7280;
    line-height: 1.5;
}

body.mtb-modal-active {
    overflow: hidden;
}

/* ===== Form ===== */
.mtb-form .mtb-row {
    display: flex; gap: 12px;
}
.mtb-form .mtb-field {
    margin-bottom: 14px;
    flex: 1;
}
.mtb-form .mtb-field-half { flex: 1; }
.mtb-form label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
.mtb-required { color: #dc2626; }

.mtb-form input[type="text"],
.mtb-form input[type="email"],
.mtb-form input[type="tel"],
.mtb-form input[type="date"],
.mtb-form select,
.mtb-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #1f2937;
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.mtb-form input:focus,
.mtb-form select:focus,
.mtb-form textarea:focus {
    outline: none;
    border-color: #3D3C6C;
    box-shadow: 0 0 0 3px rgba(61, 60, 108, 0.15);
}
.mtb-form .mtb-error {
    border-color: #dc2626 !important;
    background: #fef2f2;
}

.mtb-radio-group {
    display: flex; gap: 14px; flex-wrap: wrap;
}
.mtb-radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    font-weight: 500;
}
.mtb-radio input[type="radio"] { margin: 0; }

.mtb-info {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px 12px;
    margin: 4px 0 16px;
    font-size: 13px;
    color: #374151;
}

.mtb-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px; height: 1px; overflow: hidden;
}

.mtb-submit-row { margin-top: 10px; }
.mtb-submit-btn {
    width: 100%;
    background: #3D3C6C;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 13px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
}
.mtb-submit-btn:hover:not(:disabled) { background: #2a2a5a; }
.mtb-submit-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.mtb-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mtb-message-box {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
}
.mtb-message-box.mtb-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.mtb-message-box.mtb-error-msg {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

@media (max-width: 480px) {
    .mtb-modal-dialog { padding: 22px 18px; }
    .mtb-form .mtb-row { flex-direction: column; gap: 0; }
}
