/* ── Martilla Booking Form — Styles ───────────────────────────────────────── */

.mbf-wrap {
    --mbf-primary:   #2e7d32;
    --mbf-primary-h: #1b5e20;
    --mbf-accent:    #43a047;
    --mbf-text:      #1a1a1a;
    --mbf-muted:     #666;
    --mbf-border:    #dde1e7;
    --mbf-bg:        #fff;
    --mbf-bg-soft:   #f7f9f7;
    --mbf-error:     #c62828;
    --mbf-radius:    10px;
    --mbf-shadow:    0 4px 24px rgba(0,0,0,.08);

    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    color: var(--mbf-text);
    max-width: 740px;
    margin: 0 auto;
    background: var(--mbf-bg);
    border-radius: var(--mbf-radius);
    box-shadow: var(--mbf-shadow);
    overflow: hidden;
}

/* ── Progress bar ─────────────────────────────────────────────────────────── */

.mbf-progress {
    display: flex;
    align-items: center;
    padding: 20px 30px;
    background: var(--mbf-bg-soft);
    border-bottom: 1px solid var(--mbf-border);
    gap: 0;
}

.mbf-step-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.mbf-step-num {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #ccc;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    transition: background .3s;
}

.mbf-step-label.active   .mbf-step-num { background: var(--mbf-primary); }
.mbf-step-label.done     .mbf-step-num { background: var(--mbf-accent); }

.mbf-step-text {
    font-size: 11px;
    color: var(--mbf-muted);
    white-space: nowrap;
}
.mbf-step-label.active .mbf-step-text { color: var(--mbf-primary); font-weight: 600; }

.mbf-step-bar {
    flex: 1;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin: 0 8px;
    position: relative;
    overflow: hidden;
}
.mbf-step-fill {
    height: 100%;
    background: var(--mbf-accent);
    border-radius: 2px;
    transition: width .4s ease;
}

/* ── Pages ────────────────────────────────────────────────────────────────── */

.mbf-page {
    display: none;
    padding: 28px 32px 24px;
    animation: mbfFadeIn .25s ease;
}
.mbf-page.active { display: block; }

@keyframes mbfFadeIn {
    from { opacity: 0; transform: translateX(18px); }
    to   { opacity: 1; transform: translateX(0); }
}

.mbf-page-title {
    font-size: 1.3em;
    font-weight: 700;
    margin: 0 0 22px;
    color: var(--mbf-primary);
    border-bottom: 2px solid var(--mbf-accent);
    padding-bottom: 10px;
}

/* ── Fields ───────────────────────────────────────────────────────────────── */

.mbf-field { margin-bottom: 18px; }
.mbf-full  { width: 100%; }
.mbf-half  { flex: 1 1 48%; min-width: 180px; }

.mbf-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.mbf-label {
    display: block;
    font-weight: 600;
    font-size: .875em;
    margin-bottom: 6px;
    color: var(--mbf-text);
}
.mbf-req { color: var(--mbf-error); }

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="number"],
textarea,
.mbf-wrap select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--mbf-border);
    border-radius: 7px;
    font-size: .95em;
    font-family: inherit;
    background: #fff;
    color: var(--mbf-text);
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--mbf-accent);
    box-shadow: 0 0 0 3px rgba(67,160,71,.18);
}

.mbf-select-wrap {
    position: relative;
}
.mbf-select-wrap::after {
    content: '▾';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--mbf-muted);
    font-size: .9em;
}

textarea { resize: vertical; min-height: 80px; }

/* ── Product grid (qty inputs) ───────────────────────────────────────────── */

.mbf-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.mbf-product-item {
    background: var(--mbf-bg-soft);
    border: 1.5px solid var(--mbf-border);
    border-radius: 8px;
    padding: 12px;
}

.mbf-product-item label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .85em;
    font-weight: 600;
    margin-bottom: 8px;
}

.mbf-price { color: var(--mbf-primary); font-size: .9em; }

.mbf-product-item input[type="number"] {
    padding: 6px 10px;
    font-size: .95em;
    text-align: center;
    width: 80px;
}

/* ── Total preview ───────────────────────────────────────────────────────── */

.mbf-total-preview {
    margin: 8px 0 18px;
    padding: 12px 16px;
    background: #e8f5e9;
    border: 1.5px solid #a5d6a7;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mbf-total-label { font-weight: 600; color: var(--mbf-primary); }
.mbf-total-value { font-size: 1.3em; font-weight: 700; color: var(--mbf-primary); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.mbf-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--mbf-border);
}

.mbf-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: .95em;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .1s;
}

.mbf-btn-next, .mbf-btn-pay {
    background: var(--mbf-primary);
    color: #fff;
}
.mbf-btn-next:hover, .mbf-btn-pay:hover {
    background: var(--mbf-primary-h);
    transform: translateY(-1px);
}

.mbf-btn-prev {
    background: transparent;
    color: var(--mbf-muted);
    border: 1.5px solid var(--mbf-border);
}
.mbf-btn-prev:hover { background: var(--mbf-bg-soft); }

.mbf-btn-sm { padding: 9px 18px; font-size: .875em; }

.mbf-btn-pay {
    width: 100%;
    margin-top: 14px;
    padding: 14px;
    font-size: 1em;
    letter-spacing: .01em;
}

.mbf-btn-quote { background: #1565c0; }
.mbf-btn-quote:hover { background: #0d47a1; }

.mbf-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ── Summary box ─────────────────────────────────────────────────────────── */

.mbf-summary {
    background: var(--mbf-bg-soft);
    border: 1.5px solid var(--mbf-border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 22px;
}
.mbf-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: .9em;
    border-bottom: 1px solid var(--mbf-border);
}
.mbf-summary-row:last-child { border: none; }
.mbf-summary-total {
    padding-top: 10px;
    font-size: 1em;
}
.mbf-summary-total strong { color: var(--mbf-primary); font-size: 1.2em; }

/* ── Payment methods ─────────────────────────────────────────────────────── */

.mbf-payment-methods { margin-top: 20px; }

.mbf-pay-title {
    font-size: 1em;
    font-weight: 700;
    margin-bottom: 14px;
}

.mbf-method-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mbf-method-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 2px solid var(--mbf-border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: .875em;
    transition: border-color .2s, background .2s;
    user-select: none;
}
.mbf-method-tab input { display: none; }
.mbf-method-tab.active {
    border-color: var(--mbf-primary);
    background: #e8f5e9;
    color: var(--mbf-primary);
}
.mbf-tab-icon { font-size: 1.1em; }

/* ── Stripe element ──────────────────────────────────────────────────────── */

#mbf-card-element {
    border: 1.5px solid var(--mbf-border);
    border-radius: 8px;
    padding: 13px 14px;
    background: #fff;
    transition: border-color .2s;
}
#mbf-card-element:focus-within {
    border-color: var(--mbf-accent);
    box-shadow: 0 0 0 3px rgba(67,160,71,.18);
}

/* ── Spinner ─────────────────────────────────────────────────────────────── */

.mbf-spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mbfSpin .7s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
}
@keyframes mbfSpin { to { transform: rotate(360deg); } }

/* ── Error messages ──────────────────────────────────────────────────────── */

.mbf-error {
    color: var(--mbf-error);
    font-size: .85em;
    margin-top: 8px;
    min-height: 18px;
}

.mbf-quote-note {
    padding: 14px;
    background: #e3f2fd;
    border: 1.5px solid #90caf9;
    border-radius: 8px;
    font-size: .9em;
    color: #0d47a1;
    margin-bottom: 4px;
}

/* ── Success screen ──────────────────────────────────────────────────────── */

.mbf-success {
    text-align: center;
    padding: 48px 32px !important;
}
.mbf-success-icon { font-size: 3.5em; margin-bottom: 16px; }
.mbf-success h2   { font-size: 1.6em; color: var(--mbf-primary); margin: 0 0 12px; }
.mbf-success p    { color: var(--mbf-muted); font-size: .95em; }
.mbf-success-contact a { color: var(--mbf-primary); font-weight: 700; }

/* ── Validation ──────────────────────────────────────────────────────────── */

.mbf-field-error input,
.mbf-field-error select,
.mbf-field-error textarea {
    border-color: var(--mbf-error) !important;
}
.mbf-inline-error {
    color: var(--mbf-error);
    font-size: .82em;
    margin-top: 4px;
    display: block;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 580px) {
    .mbf-page        { padding: 20px 18px 16px; }
    .mbf-progress    { padding: 14px 18px; }
    .mbf-step-text   { display: none; }
    .mbf-product-grid { grid-template-columns: repeat(2, 1fr); }
    .mbf-actions     { flex-direction: column-reverse; }
    .mbf-btn-next    { width: 100%; }
    .mbf-method-tabs { flex-direction: column; }
    .mbf-method-tab  { width: 100%; }
}
