/* =============================================================================
   Missionary Trips Manager — Frontend Styles
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Design Tokens ──────────────────────────────────────────────────────────── */
:root {
    --mtm-brand: #6366f1;
    --mtm-brand-dark: #4338ca;
    --mtm-brand-light: #eef2ff;
    --mtm-success: #10b981;
    --mtm-error: #ef4444;
    --mtm-warning: #f59e0b;
    --mtm-info: #0ea5e9;
    --mtm-text: #0f172a;
    --mtm-text-muted: #64748b;
    --mtm-border: #e2e8f0;
    --mtm-surface: #ffffff;
    --mtm-bg: #f8fafc;
    --mtm-radius-sm: 6px;
    --mtm-radius: 12px;
    --mtm-radius-lg: 18px;
    --mtm-shadow: 0 4px 24px rgba(99, 102, 241, .08);
    --mtm-shadow-hover: 0 8px 32px rgba(99, 102, 241, .16);
    --mtm-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Wrapper ──────────────────────────────────────────────────────────────── */
.mtm-wrap {
    font-family: var(--mtm-font);
    color: var(--mtm-text);
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 0 48px;
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.mtm-card {
    background: var(--mtm-surface);
    border: 1px solid var(--mtm-border);
    border-radius: var(--mtm-radius);
    padding: 32px;
    box-shadow: var(--mtm-shadow);
    margin-bottom: 24px;
    transition: box-shadow .2s ease;
}

.mtm-card:hover {
    box-shadow: var(--mtm-shadow-hover);
}

.mtm-card--secondary {
    background: var(--mtm-bg);
    box-shadow: none;
}

.mtm-card__title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 20px;
    letter-spacing: -.4px;
    color: var(--mtm-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.mtm-icon {
    font-size: 1.4rem;
}

.mtm-icon-sm {
    font-size: 1rem;
}

.mtm-dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 4px;
}

.mtm-group-tag {
    color: var(--mtm-text-muted);
    font-size: .9rem;
    margin: 0 0 24px;
}

/* ── Badges ───────────────────────────────────────────────────────────────── */
.mtm-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    background: var(--mtm-brand-light);
    color: var(--mtm-brand);
    letter-spacing: .4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.mtm-badge--completed {
    background: #d1fae5;
    color: #065f46;
}

.mtm-badge--active {
    background: #dbeafe;
    color: #1e40af;
}

.mtm-badge--pending {
    background: #fef9c3;
    color: #854d0e;
}

.mtm-badge--failed {
    background: #fee2e2;
    color: #991b1b;
}

/* ── Stats Grid ───────────────────────────────────────────────────────────── */
.mtm-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.mtm-stats-grid--compact {
    grid-template-columns: repeat(3, 1fr);
}

.mtm-stat-card {
    background: var(--mtm-bg);
    border: 1px solid var(--mtm-border);
    border-radius: var(--mtm-radius-sm);
    padding: 18px 20px;
    text-align: center;
}

.mtm-stat-card--paid {
    border-color: #6ee7b7;
    background: #ecfdf5;
}

.mtm-stat-card--balance {
    border-color: #fca5a5;
    background: #fef2f2;
}

.mtm-stat-card__label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--mtm-text-muted);
    margin-bottom: 6px;
}

.mtm-stat-card__value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--mtm-text);
}

/* ── Progress Bar ─────────────────────────────────────────────────────────── */
.mtm-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--mtm-border);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 8px;
}

.mtm-progress-bar__inner {
    height: 100%;
    background: linear-gradient(90deg, var(--mtm-brand) 0%, var(--mtm-success) 100%);
    border-radius: 999px;
    transition: width .6s ease;
}

.mtm-progress-label {
    font-size: .8rem;
    color: var(--mtm-text-muted);
    margin: 6px 0 0;
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
.mtm-form {
    margin-top: 8px;
}

.mtm-field {
    margin-bottom: 22px;
}

.mtm-label {
    display: block;
    font-weight: 600;
    font-size: .88rem;
    color: var(--mtm-text);
    margin-bottom: 8px;
}

.mtm-input,
.mtm-select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--mtm-border);
    border-radius: var(--mtm-radius-sm);
    font-size: 1rem;
    font-family: var(--mtm-font);
    color: var(--mtm-text);
    background: var(--mtm-surface);
    transition: border-color .15s, box-shadow .15s;
    appearance: auto;
    box-sizing: border-box;
}

.mtm-input:focus,
.mtm-select:focus {
    outline: none;
    border-color: var(--mtm-brand);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
}

.mtm-hint {
    font-size: .8rem;
    color: var(--mtm-text-muted);
    margin: 6px 0 0;
}

/* Radio Group */
.mtm-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mtm-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .92rem;
    cursor: pointer;
}

.mtm-radio input[type="radio"] {
    accent-color: var(--mtm-brand);
    width: 18px;
    height: 18px;
}

/* Form Actions */
.mtm-form__actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.mtm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 28px;
    border-radius: var(--mtm-radius-sm);
    font-size: .95rem;
    font-weight: 700;
    font-family: var(--mtm-font);
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: transform .15s, box-shadow .15s, opacity .15s;
    letter-spacing: .2px;
}

.mtm-btn--primary {
    background: linear-gradient(135deg, var(--mtm-brand) 0%, var(--mtm-brand-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, .35);
}

.mtm-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, .45);
    color: #fff;
}

.mtm-btn--primary:active {
    transform: translateY(0);
}

.mtm-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

/* ── Cost Badge ───────────────────────────────────────────────────────────── */
.mtm-cost-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--mtm-brand-light) 0%, #e0e7ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: var(--mtm-radius-sm);
    padding: 12px 20px;
    font-size: .9rem;
    color: var(--mtm-brand-dark);
    font-weight: 600;
}

.mtm-cost-badge strong {
    font-size: 1.2rem;
}

/* ── Tables ───────────────────────────────────────────────────────────────── */
.mtm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

.mtm-table th {
    text-align: left;
    padding: 10px 14px;
    background: var(--mtm-bg);
    color: var(--mtm-text-muted);
    font-weight: 600;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 2px solid var(--mtm-border);
}

.mtm-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--mtm-border);
    vertical-align: middle;
}

.mtm-table tr:last-child td {
    border-bottom: none;
}

.mtm-table code {
    background: var(--mtm-bg);
    border: 1px solid var(--mtm-border);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: .8rem;
}

/* Colors for balance cells */
.mtm-green {
    color: var(--mtm-success);
    font-weight: 600;
}

.mtm-red {
    color: var(--mtm-error);
    font-weight: 600;
}

/* ── Notices ──────────────────────────────────────────────────────────────── */
.mtm-notice {
    padding: 14px 18px;
    border-radius: var(--mtm-radius-sm);
    margin-bottom: 20px;
    font-size: .92rem;
    font-family: var(--mtm-font);
    font-weight: 500;
    border-left: 4px solid currentColor;
}

.mtm-notice--success {
    background: #d1fae5;
    color: #065f46;
    border-color: var(--mtm-success);
}

.mtm-notice--error {
    background: #fee2e2;
    color: #7f1d1d;
    border-color: var(--mtm-error);
}

.mtm-notice--info {
    background: #e0f2fe;
    color: #0c4a6e;
    border-color: var(--mtm-info);
}

.mtm-notice--warning {
    background: #fef9c3;
    color: #713f12;
    border-color: var(--mtm-warning);
}

/* ── Stripe Element ───────────────────────────────────────────────────────── */
.mtm-stripe-element {
    padding: 14px 16px;
    border: 1.5px solid var(--mtm-border);
    border-radius: var(--mtm-radius-sm);
    background: var(--mtm-surface);
    transition: border-color .15s;
}

.mtm-stripe-element.StripeElement--focus {
    border-color: var(--mtm-brand);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
}

.mtm-card-errors {
    color: var(--mtm-error);
    font-size: .85rem;
    margin-top: 8px;
    min-height: 20px;
}

/* ── Requirements ─────────────────────────────────────────────────────────── */
.mtm-requirements {
    line-height: 1.7;
    color: var(--mtm-text-muted);
    font-size: .9rem;
}

/* =============================================================================
   Admin Styles
   ========================================================================== */
.mtm-admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin: 20px 0 30px;
}

.mtm-kpi-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.mtm-kpi-card__value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.mtm-kpi-card__label {
    font-size: .78rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-top: 6px;
}

.mtm-admin-cols {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.mtm-admin-panel {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
}

.mtm-admin-panel h2 {
    margin-top: 0;
    font-size: 1.05rem;
    color: #0f172a;
    font-weight: 700;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.mtm-trip-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mtm-trip-list li {
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: .9rem;
}

.mtm-trip-list li:last-child {
    border-bottom: none;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 700px) {

    .mtm-stats-grid,
    .mtm-stats-grid--compact {
        grid-template-columns: 1fr 1fr;
    }

    .mtm-admin-cols {
        grid-template-columns: 1fr;
    }

    .mtm-dashboard-header {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .mtm-card {
        padding: 20px;
    }

    .mtm-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Login/Register Forms ─────────────────────────────────────────────── */

.mtm-login-form input[type="text"],
.mtm-login-form input[type="password"],
.mtm-login-form input[type="email"],
.mtm-register-form .mtm-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--mtm-border);
    border-radius: var(--mtm-radius-sm);
    font-size: 1rem;
    font-family: var(--mtm-font);
    box-sizing: border-box;
}

.mtm-login-form input:focus,
.mtm-register-form .mtm-input:focus {
    outline: none;
    border-color: var(--mtm-brand);
    box-shadow: 0 0 0 3px var(--mtm-brand-light);
}

.mtm-login-form .forgetmenot label {
    font-size: 0.9rem;
    color: var(--mtm-text-muted);
}

.mtm-login-links,
.mtm-register-form .mtm-login-links {
    font-size: 0.9rem;
    color: var(--mtm-text-muted);
    margin-top: 16px;
    text-align: center;
}

.mtm-login-links a,
.mtm-register-form .mtm-login-links a {
    color: var(--mtm-brand);
    text-decoration: none;
    font-weight: 500;
}

.mtm-login-links a:hover,
.mtm-register-form .mtm-login-links a:hover {
    text-decoration: underline;
}

.mtm-logout-link {
    display: inline-block;
    padding: 8px 16px;
    background: var(--mtm-bg);
    border: 1px solid var(--mtm-border);
    border-radius: var(--mtm-radius-sm);
    color: var(--mtm-text);
    text-decoration: none;
    font-weight: 500;
}

.mtm-logout-link:hover {
    background: var(--mtm-error);
    border-color: var(--mtm-error);
    color: white;
}

#mtm-login-form .submit input#wp-submit,
#mtm-register-form button[type="submit"],
.mtm-register-form .mtm-btn {
    width: 100%;
    margin-top: 8px;
}