/* ============================================================
   MM Form — Multi-step form engine
   MorgansMedia · Strategic Growth Consultancy
   ============================================================ */

.mmf-root {
    --mmf-brand: #00AEEF;
    --mmf-brand-dark: #008AC5;
    --mmf-radius: 14px;
    --mmf-ease: cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: inherit;
    width: 100%;
}

/* ---------- HEADER / PROGRESS ---------- */
.mmf-header {
    margin-bottom: 1.75rem;
}
.mmf-progress-track {
    height: 4px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 999px;
    overflow: hidden;
}
.dark .mmf-progress-track {
    background: rgba(255, 255, 255, 0.08);
}
.mmf-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--mmf-brand) 0%, #66FCF1 100%);
    border-radius: 999px;
    transition: width 0.5s var(--mmf-ease);
}
.mmf-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.5);
}
.dark .mmf-progress-meta {
    color: rgba(255, 255, 255, 0.5);
}
.mmf-progress-meta .mmf-step-label {
    color: var(--mmf-brand);
    font-weight: 700;
}

/* ---------- STEP CONTAINER ---------- */
.mmf-stage {
    position: relative;
    min-height: 240px;
}
.mmf-step {
    display: none;
    animation: mmf-fade-in 0.4s var(--mmf-ease);
}
.mmf-step.is-active {
    display: block;
}
@keyframes mmf-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.mmf-step-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
    color: rgb(17, 24, 39);
}
.dark .mmf-step-title {
    color: #fff;
}
.mmf-step-subtitle {
    font-size: 0.95rem;
    color: rgb(107, 114, 128);
    margin-bottom: 2rem;
    line-height: 1.6;
}
.dark .mmf-step-subtitle {
    color: rgb(156, 163, 175);
}

/* ---------- TILES (single & multi-select) ---------- */
.mmf-tiles {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}
@media (min-width: 640px) {
    .mmf-tiles[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
    .mmf-tiles[data-cols="3"] { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
    .mmf-tiles[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
    .mmf-tiles[data-cols="4"] { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .mmf-tiles[data-cols="4"] { grid-template-columns: repeat(4, 1fr); }
}

.mmf-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 1.5rem 1.4rem;
    min-height: 130px;
    background: rgba(255, 255, 255, 0.6);
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--mmf-radius);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s var(--mmf-ease);
    width: 100%;
    font-family: inherit;
    color: inherit;
}
.dark .mmf-tile {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}
.mmf-tile:hover {
    border-color: var(--mmf-brand);
    background: rgba(0, 174, 239, 0.04);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px -8px rgba(0, 174, 239, 0.2);
}
.dark .mmf-tile:hover {
    background: rgba(0, 174, 239, 0.08);
}
.mmf-tile.is-selected {
    border-color: var(--mmf-brand);
    background: rgba(0, 174, 239, 0.07);
    box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.15);
}
.dark .mmf-tile.is-selected {
    background: rgba(0, 174, 239, 0.12);
    box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.2);
}
.mmf-tile-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: rgba(0, 174, 239, 0.1);
    color: var(--mmf-brand);
    margin-bottom: 0.4rem;
}
.mmf-tile.is-selected .mmf-tile-icon {
    background: var(--mmf-brand);
    color: #fff;
}
.mmf-tile-icon svg {
    width: 20px;
    height: 20px;
}
.mmf-tile-label {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.3;
    color: rgb(17, 24, 39);
}
.dark .mmf-tile-label {
    color: #fff;
}
.mmf-tile-desc {
    font-size: 0.82rem;
    color: rgb(107, 114, 128);
    line-height: 1.5;
}
.dark .mmf-tile-desc {
    color: rgb(156, 163, 175);
}
.mmf-tile-check {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--mmf-brand);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
}
.mmf-tile-check svg {
    width: 14px;
    height: 14px;
}
.mmf-tile.is-selected .mmf-tile-check {
    display: flex;
}

/* ---------- FIELDS (final contact step) ---------- */
.mmf-fields {
    display: grid;
    gap: 1.25rem;
}
.mmf-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.mmf-field-row {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr;
}
@media (min-width: 640px) {
    .mmf-field-row { grid-template-columns: 1fr 1fr; }
}
.mmf-field label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgb(75, 85, 99);
}
.dark .mmf-field label {
    color: rgb(156, 163, 175);
}
.mmf-field input,
.mmf-field textarea,
.mmf-field select {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(0, 0, 0, 0.02);
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    color: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.dark .mmf-field input,
.dark .mmf-field textarea,
.dark .mmf-field select {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.mmf-field input:focus,
.mmf-field textarea:focus,
.mmf-field select:focus {
    border-color: var(--mmf-brand);
    box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.12);
}
.mmf-field textarea {
    min-height: 110px;
    resize: vertical;
}
.mmf-field-error {
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: 0.25rem;
    display: none;
}
.mmf-field.has-error input,
.mmf-field.has-error textarea,
.mmf-field.has-error select {
    border-color: #ef4444;
}
.mmf-field.has-error .mmf-field-error {
    display: block;
}
.mmf-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.9rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 10px;
    font-size: 0.8rem;
    color: rgb(107, 114, 128);
    line-height: 1.5;
}
.dark .mmf-consent {
    background: rgba(255, 255, 255, 0.02);
    color: rgb(156, 163, 175);
}
.mmf-consent input {
    margin-top: 2px;
    accent-color: var(--mmf-brand);
}
.mmf-consent a {
    color: var(--mmf-brand);
    text-decoration: underline;
}

/* ---------- ACTIONS ---------- */
.mmf-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.dark .mmf-actions {
    border-top-color: rgba(255, 255, 255, 0.06);
}
.mmf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s var(--mmf-ease);
    border: none;
    font-family: inherit;
    white-space: nowrap;
}
.mmf-btn-back {
    background: transparent;
    color: rgb(107, 114, 128);
    padding-left: 0;
}
.dark .mmf-btn-back { color: rgb(156, 163, 175); }
.mmf-btn-back:hover { color: var(--mmf-brand); }
.mmf-btn-back[disabled] {
    visibility: hidden;
}
.mmf-btn-next {
    background: rgb(17, 24, 39);
    color: #fff;
    box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.3);
}
.dark .mmf-btn-next {
    background: #fff;
    color: #000;
}
.mmf-btn-next:hover {
    background: var(--mmf-brand);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 12px 28px -10px rgba(0, 174, 239, 0.4);
}
.mmf-btn-next[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}
.mmf-btn-next svg {
    width: 16px;
    height: 16px;
}

/* ---------- SUCCESS / FAILURE ---------- */
.mmf-result {
    display: none;
    text-align: center;
    padding: 2.5rem 1rem 1rem;
    animation: mmf-fade-in 0.4s var(--mmf-ease);
}
.mmf-result.is-active { display: block; }
.mmf-result-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    background: rgba(34, 197, 94, 0.12);
    color: rgb(34, 197, 94);
}
.mmf-result-icon svg { width: 32px; height: 32px; }
.mmf-result.is-error .mmf-result-icon {
    background: rgba(239, 68, 68, 0.12);
    color: rgb(239, 68, 68);
}
.mmf-result-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: rgb(17, 24, 39);
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}
.dark .mmf-result-title { color: #fff; }
.mmf-result-message {
    color: rgb(107, 114, 128);
    margin-bottom: 1.75rem;
    line-height: 1.6;
}
.dark .mmf-result-message { color: rgb(156, 163, 175); }
.mmf-result-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---------- LOADING SPINNER ---------- */
.mmf-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mmf-spin 0.7s linear infinite;
}
.dark .mmf-btn-next .mmf-spinner {
    border-color: rgba(0, 0, 0, 0.2);
    border-top-color: #000;
}
@keyframes mmf-spin {
    to { transform: rotate(360deg); }
}

/* ---------- SUMMARY (last step before submit) ---------- */
.mmf-summary {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--mmf-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.dark .mmf-summary {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.06);
}
.mmf-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.85rem;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.06);
}
.dark .mmf-summary-row {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}
.mmf-summary-row:last-child { border-bottom: none; }
.mmf-summary-key {
    color: rgb(107, 114, 128);
    font-weight: 500;
}
.dark .mmf-summary-key { color: rgb(156, 163, 175); }
.mmf-summary-val {
    color: rgb(17, 24, 39);
    font-weight: 600;
    text-align: right;
    max-width: 60%;
}
.dark .mmf-summary-val { color: #fff; }
