/* Matrix MLM Pro - Public Styles */
:root {
    --matrix-primary: #4f46e5;
    --matrix-secondary: #7c3aed;
    --matrix-success: #10b981;
    --matrix-danger: #ef4444;
    --matrix-warning: #f59e0b;
    --matrix-info: #3b82f6;
    --matrix-dark: #1f2937;
    --matrix-light: #f9fafb;
    --matrix-border: #e5e7eb;
    --matrix-radius: 8px;
    --matrix-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
}

/* Auth Pages */
.matrix-auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 40px 20px;
}

.matrix-auth-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--matrix-shadow);
    padding: 40px;
    width: 100%;
    max-width: 480px;
    border: 1px solid var(--matrix-border);
}

.matrix-auth-header {
    text-align: center;
    margin-bottom: 30px;
}

/* Login-page logo. Sized to coexist with the auth-card padding
 * on phones as small as 320px wide:
 *   - The img is display:block + auto-margin instead of inline-block
 *     so centering doesn't depend on the parent's text-align cascade
 *     (some themes reset text-align inside form blocks).
 *   - max-width uses min(240px, 100%) so the image is bounded by
 *     EITHER the 240px desktop cap OR the available content width,
 *     whichever is smaller — prevents overflow when a theme leaks
 *     `width: auto` => natural-pixel rendering on a logo whose
 *     intrinsic resolution is huge (e.g. a 1500px-wide PNG uploaded
 *     for retina displays).
 *   - object-fit: contain pins aspect ratio even if a downstream
 *     rule sets explicit width/height on IMG, which WordPress's
 *     auto-attribute injection can do depending on theme/version.
 *   - Mobile breakpoint tightens both axes so a tall/square logo
 *     can't dominate the auth card on phones — 60px tall keeps
 *     vertical proportion under the heading.
 */
.matrix-auth-logo {
    margin: 0 auto 20px;
    line-height: 0;
    text-align: center;
}

.matrix-auth-logo img {
    display: block;
    margin: 0 auto;
    max-width: min(240px, 100%);
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
}

@media (max-width: 480px) {
    .matrix-auth-logo img {
        max-width: 180px;
        max-height: 60px;
    }
}

.matrix-auth-header h2 {
    font-size: 24px;
    color: var(--matrix-dark);
    margin-bottom: 8px;
}

.matrix-auth-header p {
    color: #6b7280;
    font-size: 14px;
}

.matrix-auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--matrix-border);
}

.matrix-auth-footer p {
    color: #4b5563;
    font-size: 14px;
    margin: 6px 0;
}

.matrix-auth-footer a {
    color: var(--matrix-primary);
    text-decoration: none;
    font-weight: 500;
}

.matrix-auth-footer a:hover {
    text-decoration: underline;
}

/* Forms */
.matrix-form-group {
    margin-bottom: 16px;
}

.matrix-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.matrix-form-group input,
.matrix-form-group select,
.matrix-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--matrix-border);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.matrix-form-group input:focus,
.matrix-form-group select:focus,
.matrix-form-group textarea:focus {
    outline: none;
    border-color: var(--matrix-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Checkboxes and radios should not be stretched like text inputs */
.matrix-form-group input[type="checkbox"],
.matrix-form-group input[type="radio"] {
    width: auto;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    box-shadow: none;
}

.matrix-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.matrix-form-check label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 400;
    color: #374151;
    cursor: pointer;
    margin-bottom: 0;
}

.matrix-form-check {
    margin-bottom: 20px;
}

/* Buttons */
.matrix-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    gap: 8px;
}

.matrix-btn-primary {
    background: var(--matrix-primary);
    color: #fff;
}

.matrix-btn-primary:hover {
    background: #4338ca;
    transform: translateY(-1px);
}

.matrix-btn-success { background: var(--matrix-success); color: #fff; }
.matrix-btn-danger { background: var(--matrix-danger); color: #fff; }
.matrix-btn-warning { background: var(--matrix-warning); color: #fff; }

.matrix-btn-block {
    width: 100%;
}

.matrix-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Plans Section */
.matrix-plans-section {
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.matrix-section-header {
    text-align: center;
    margin-bottom: 40px;
}

.matrix-section-header h2 {
    font-size: 32px;
    color: var(--matrix-dark);
    margin-bottom: 10px;
}

.matrix-section-header p {
    color: #6b7280;
    font-size: 16px;
}

.matrix-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.matrix-plan-card {
    background: #fff;
    border: 1px solid var(--matrix-border);
    border-radius: 12px;
    padding: 30px;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.matrix-plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.matrix-plan-card .plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.matrix-plan-card .plan-header h3 {
    font-size: 18px;
    color: var(--matrix-dark);
    margin: 0;
}

.plan-matrix-badge {
    background: linear-gradient(135deg, var(--matrix-primary), var(--matrix-secondary));
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.plan-price {
    margin-bottom: 20px;
}

.plan-price .price-amount {
    font-size: 36px;
    font-weight: 700;
    color: var(--matrix-primary);
}

.plan-price .price-period {
    font-size: 14px;
    color: #6b7280;
    margin-left: 4px;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
}

.plan-features li {
    padding: 8px 0;
    border-bottom: 1px solid var(--matrix-border);
    font-size: 14px;
    color: #4b5563;
}

.plan-features li:last-child {
    border-bottom: none;
}

/* Alerts */
.matrix-alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.matrix-alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.matrix-alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.matrix-alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.matrix-alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* Badges */
.matrix-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.matrix-badge-active, .matrix-badge-completed, .matrix-badge-approved, .matrix-badge-credit { background: #ecfdf5; color: #065f46; }
.matrix-badge-pending, .matrix-badge-medium { background: #fffbeb; color: #92400e; }
.matrix-badge-inactive, .matrix-badge-rejected, .matrix-badge-cancelled, .matrix-badge-debit { background: #fef2f2; color: #991b1b; }
.matrix-badge-open, .matrix-badge-info, .matrix-badge-low { background: #eff6ff; color: #1e40af; }
.matrix-badge-high, .matrix-badge-urgent, .matrix-badge-customer_reply { background: #fef2f2; color: #991b1b; }
.matrix-badge-answered { background: #ecfdf5; color: #065f46; }
.matrix-badge-closed { background: #f3f4f6; color: #6b7280; }
.matrix-badge-unused { background: #eff6ff; color: #1e40af; }
.matrix-badge-used { background: #ecfdf5; color: #065f46; }
.matrix-badge-expired { background: #f3f4f6; color: #6b7280; }

/* Tables */
.matrix-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--matrix-shadow);
    margin: 16px 0;
}

.matrix-table thead th {
    background: var(--matrix-dark);
    color: #fff;
    padding: 12px 16px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

.matrix-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--matrix-border);
    font-size: 13px;
}

.matrix-table tbody tr:hover {
    background: #f9fafb;
}

.text-success { color: var(--matrix-success) !important; font-weight: 600; }
.text-danger { color: var(--matrix-danger) !important; font-weight: 600; }

/* Info Box */
.matrix-info-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.matrix-info-box p {
    margin: 4px 0;
    font-size: 14px;
    color: #1e40af;
}

/* Gateway Options */
.matrix-gateway-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.matrix-gateway-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    border: 2px solid var(--matrix-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.matrix-gateway-option:has(input:checked) {
    border-color: var(--matrix-primary);
    background: rgba(79, 70, 229, 0.05);
}

.matrix-gateway-option input[type="radio"] {
    width: auto;
    margin-bottom: 8px;
}

.gateway-name {
    font-weight: 600;
    font-size: 14px;
}

.gateway-charge {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
}

/* Form Card */
.matrix-form-card {
    background: #fff;
    border: 1px solid var(--matrix-border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

/* Referral Box */
.matrix-referral-box {
    background: linear-gradient(135deg, var(--matrix-primary), var(--matrix-secondary));
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
    color: #fff;
}

.matrix-referral-box h3 {
    margin: 0 0 12px;
    color: #fff;
}

.matrix-referral-link {
    display: flex;
    gap: 8px;
}

.matrix-referral-link input {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    border: none;
    font-size: 13px;
    background: rgba(255,255,255,0.9);
}

/* Ticket Messages */
.matrix-ticket-messages {
    margin: 20px 0;
}

.matrix-message {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.matrix-message.user-reply {
    background: #f3f4f6;
    margin-right: 40px;
}

.matrix-message.admin-reply {
    background: #eff6ff;
    margin-left: 40px;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

.message-body {
    font-size: 14px;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .matrix-form-row {
        grid-template-columns: 1fr;
    }
    .matrix-plans-grid {
        grid-template-columns: 1fr;
    }
    .matrix-gateway-options {
        grid-template-columns: 1fr;
    }
    .matrix-auth-card {
        padding: 24px;
    }
}



/* ============================================================
 * Member Benefits — dashboard tab + admin-managed card grid.
 * The modal is intentionally lightweight (no jQuery, no Bootstrap)
 * so it works even on stripped-down themes that defer or remove
 * the dashboard's main JS bundle.
 * ============================================================ */

.matrix-benefits-panel h2 {
    margin: 0 0 8px;
}
.matrix-benefits-intro {
    color: #6b7280;
    font-size: 14px;
    margin: 0 0 24px;
}

.matrix-benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

/* Match the wallet-to-wallet transfer card (.matrix-form-card):
 * white background, subtle border, 8px radius, flat 24px padding,
 * left-aligned content, no hover lift. */
.matrix-benefit-card {
    background: #fff;
    border: 1px solid var(--matrix-border);
    border-radius: 8px;
    padding: 24px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.matrix-benefit-card .benefit-icon {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 4px;
}

.matrix-benefit-card .benefit-icon .dashicons {
    color: var(--matrix-primary);
}

.matrix-benefit-card .benefit-icon img {
    max-width: 56px;
    max-height: 56px;
    object-fit: contain;
}

.matrix-benefit-card .benefit-title {
    margin: 0;
    font-size: 18px;
    color: var(--matrix-dark);
}

.matrix-benefit-card .benefit-short {
    margin: 0;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.5;
    flex-grow: 1;
}

.matrix-benefit-card .benefit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    margin-top: 8px;
}

.matrix-benefit-card .matrix-benefit-readmore {
    background: transparent;
    color: var(--matrix-primary);
    border: 1px solid var(--matrix-primary);
}

.matrix-benefit-card .matrix-benefit-readmore:hover {
    background: var(--matrix-primary);
    color: #fff;
}

/* Long-description modal */
.matrix-benefit-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

.matrix-benefit-modal.is-open {
    display: block;
}

.matrix-benefit-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    cursor: pointer;
}

.matrix-benefit-modal-dialog {
    position: relative;
    max-width: 600px;
    margin: 5vh auto;
    background: #fff;
    border-radius: 12px;
    padding: 32px 32px 28px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
    max-height: 85vh;
    overflow-y: auto;
}

.matrix-benefit-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 8px;
}

.matrix-benefit-modal-close:hover {
    color: #111827;
}

.matrix-benefit-modal-title {
    margin: 0 0 14px;
    color: var(--matrix-dark);
    font-size: 22px;
}

.matrix-benefit-modal-body {
    color: #374151;
    font-size: 15px;
    line-height: 1.65;
}

.matrix-benefit-modal-body p {
    margin: 0 0 12px;
}

.matrix-benefit-modal-body a {
    color: var(--matrix-primary);
}

body.matrix-benefit-modal-lock {
    overflow: hidden;
}

@media (max-width: 600px) {
    .matrix-benefit-modal-dialog {
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
        max-width: 100%;
    }
}



/* ============================================================
 * CUG (Closed User Group) application form modal — opened from
 * the "Apply for CUG" button on the Benefits-tab card. Shares the
 * dimming-backdrop / centered-dialog approach with the benefit
 * read-more modal but renders an interactive form instead of a
 * read-only body, so it gets its own component scope.
 * ============================================================ */

.matrix-cug-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

.matrix-cug-modal.is-open {
    display: block;
}

.matrix-cug-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    cursor: pointer;
}

.matrix-cug-modal-dialog {
    position: relative;
    max-width: 560px;
    margin: 5vh auto;
    background: #fff;
    border-radius: 12px;
    padding: 32px 32px 24px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
    max-height: 90vh;
    overflow-y: auto;
}

.matrix-cug-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 8px;
}

.matrix-cug-modal-close:hover {
    color: #111827;
}

.matrix-cug-modal-title {
    margin: 0 0 6px;
    color: var(--matrix-dark);
    font-size: 22px;
}

.matrix-cug-modal-intro {
    margin: 0 0 18px;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.5;
}

.matrix-cug-status {
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.45;
}

.matrix-cug-status-pending   { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.matrix-cug-status-approved  { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.matrix-cug-status-rejected  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.matrix-cug-status-cancelled { background: #f3f4f6; color: #4b5563; border: 1px solid #e5e7eb; }

.matrix-cug-form .matrix-form-group {
    margin-bottom: 14px;
}

.matrix-cug-form .matrix-form-row {
    margin-bottom: 0;
}

.matrix-cug-form .matrix-form-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: #6b7280;
}

.matrix-cug-form .matrix-form-optional {
    color: #9ca3af;
    font-weight: 400;
    font-size: 12px;
    margin-left: 4px;
}

/* Required-marker asterisk inherits color from the label so it stays
 * legible in any future theme override. */
.matrix-cug-form label span[aria-hidden="true"] {
    color: var(--matrix-danger);
    margin-left: 2px;
}

.matrix-cug-form .matrix-form-group.has-error input {
    border-color: var(--matrix-danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.matrix-cug-feedback {
    min-height: 0;
    margin: 4px 0 12px;
    font-size: 13px;
    line-height: 1.45;
}

.matrix-cug-feedback:empty {
    display: none;
}

.matrix-cug-feedback-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    padding: 10px 12px;
    border-radius: 6px;
}

.matrix-cug-feedback-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 10px 12px;
    border-radius: 6px;
}

.matrix-cug-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

body.matrix-cug-modal-lock {
    overflow: hidden;
}

@media (max-width: 600px) {
    .matrix-cug-modal-dialog {
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
        max-width: 100%;
        padding: 24px 20px 20px;
    }
    .matrix-cug-actions {
        flex-direction: column-reverse;
    }
    .matrix-cug-actions .matrix-btn {
        width: 100%;
    }
}



/* ============================================================
 * Loan application modal — wider and taller than the CUG modal
 * because the form has 30+ fields across four sections plus a
 * scrolling T&Cs block. Same belt-and-braces hide pattern (HTML
 * hidden + inline display:none + .is-open class) so the modal
 * stays invisible until JS opens it, even if the cached CSS is
 * stale.
 * ============================================================ */

.matrix-loan-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}
.matrix-loan-modal.is-open {
    display: block;
}
.matrix-loan-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    cursor: pointer;
}
.matrix-loan-modal-dialog {
    position: relative;
    max-width: 760px;
    margin: 3vh auto;
    background: #fff;
    border-radius: 12px;
    padding: 32px 32px 24px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
    max-height: 94vh;
    overflow-y: auto;
}
.matrix-loan-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 8px;
}
.matrix-loan-modal-close:hover { color: #111827; }
.matrix-loan-modal-title {
    margin: 0 0 6px;
    color: var(--matrix-dark);
    font-size: 22px;
}
.matrix-loan-modal-intro {
    margin: 0 0 18px;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.5;
}
body.matrix-loan-modal-lock { overflow: hidden; }


.matrix-loan-status {
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.45;
}
.matrix-loan-status-pending,
.matrix-loan-status-under_review { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.matrix-loan-status-approved     { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.matrix-loan-status-rejected     { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.matrix-loan-status-cancelled    { background: #f3f4f6; color: #4b5563; border: 1px solid #e5e7eb; }

.matrix-loan-section {
    border: 1px solid var(--matrix-border);
    border-radius: 8px;
    padding: 18px 18px 8px;
    margin-bottom: 18px;
}
.matrix-loan-section legend {
    font-weight: 600;
    color: var(--matrix-dark);
    padding: 0 8px;
    font-size: 15px;
}
.matrix-loan-subhead {
    font-size: 13px;
    color: #4b5563;
    margin: 14px 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.matrix-loan-hint {
    margin: 0 0 10px;
    font-size: 12px;
    color: #6b7280;
}
.matrix-loan-radios {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.matrix-loan-radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
}
.matrix-loan-radio input[type="radio"] { width: auto; margin: 0; }
.matrix-loan-file input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px dashed var(--matrix-border);
    border-radius: 6px;
    background: #f9fafb;
    font-size: 13px;
}


.matrix-loan-file-current { font-size: 12px; font-weight: 400; color: #6b7280; }
.matrix-loan-file-current a { color: var(--matrix-primary); }

.matrix-loan-terms {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--matrix-border);
    border-radius: 6px;
    padding: 12px 14px;
    background: #f9fafb;
    font-size: 12px;
    line-height: 1.55;
    color: #374151;
    margin-bottom: 14px;
}
.matrix-loan-terms p { margin: 0 0 8px; }
.matrix-loan-terms p:last-child { margin-bottom: 0; }
.matrix-loan-agree {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
}
.matrix-loan-agree input[type="checkbox"] {
    margin-top: 3px;
    width: auto;
}
.matrix-loan-feedback { min-height: 0; margin: 4px 0 12px; font-size: 13px; line-height: 1.45; }
.matrix-loan-feedback:empty { display: none; }
.matrix-loan-feedback-success {
    background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0;
    padding: 10px 12px; border-radius: 6px;
}
.matrix-loan-feedback-error {
    background: #fef2f2; color: #991b1b; border: 1px solid #fecaca;
    padding: 10px 12px; border-radius: 6px;
}
.matrix-loan-actions {
    display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px;
}
.matrix-loan-form .has-error input,
.matrix-loan-form .has-error select,
.matrix-loan-form .has-error textarea {
    border-color: var(--matrix-danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}
@media (max-width: 600px) {
    .matrix-loan-modal-dialog {
        margin: 0; border-radius: 0; max-height: 100vh; height: 100vh;
        max-width: 100%; padding: 24px 18px;
    }
    .matrix-loan-actions { flex-direction: column-reverse; }
    .matrix-loan-actions .matrix-btn { width: 100%; }
}
