/* ═══════════════════════════════════════════════════════════════
   MARV Form — Assessment Form Styles
   Brand: Magicman (#13294B navy, #93C847 green)
   Fonts: Helvetica (headings), Source Sans Pro (body)
   Radius: 0.25rem (4px) — brand standard
   ═══════════════════════════════════════════════════════════════ */

/* ── Container ── */
.marv-form-container {
    max-width: 680px;
    margin: 0 auto;
    font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ── Header & Progress — hidden (page wrapper provides context) ── */
.marv-form-header { display: none; }
.marv-form-header h2 { margin: 0; font-size: 32px; color: #13294B; font-weight: 700; }
.marv-form-header p { margin: 0; font-size: 18px; color: #3C5575; }
.marv-form-progress { display: none; }
.marv-progress-step,
.marv-step-number,
.marv-step-label,
.marv-progress-line { display: none; }

/* ── Step Indicator (injected by JS) ── */
.marv-form-step-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 0 20px;
    font-size: 13px;
    font-weight: 600;
    color: #596F8B;
    letter-spacing: 0.02em;
}

.marv-step-current {
    color: #13294B;
    font-weight: 700;
}

.marv-step-name {
    color: #13294B;
    font-weight: 600;
}

/* ── Form Body ── */
.marv-form-body {
    background: #fff;
    border-radius: 0.25rem;
    padding: 40px 36px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* ── Step Content ── */
.marv-form-step {
    animation: marvFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes marvFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.marv-form-step h3 {
    margin: 0 0 6px 0;
    font-family: Helvetica, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.75rem;
    color: #13294B;
    font-weight: 700;
    line-height: 1.2;
}

.marv-form-intro {
    margin: 0 0 28px 0;
    color: #3C5575;
    font-size: 1rem;
    line-height: 1.6;
}

/* ── Form Fields ── */
.marv-form-row {
    margin-bottom: 20px;
}

.marv-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.marv-form-field label {
    font-size: 13px;
    font-weight: 600;
    color: #13294B;
    letter-spacing: 0.01em;
}

.marv-form-field input:not([type="checkbox"]),
.marv-form-field textarea,
.marv-form-field select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #E1E5EB;
    border-radius: 0.25rem;
    font-size: 1rem;
    font-family: inherit;
    color: #13294B;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 52px;
}

.marv-form-field input::placeholder,
.marv-form-field textarea::placeholder {
    color: #596F8B;
}

.marv-form-field input:not([type="checkbox"]):focus,
.marv-form-field textarea:focus,
.marv-form-field select:focus {
    outline: none;
    border-color: #93C847;
    box-shadow: 0 0 0 4px rgba(147, 200, 71, 0.12);
}

.marv-form-field small {
    font-size: 12px;
    color: #596F8B;
}

/* ── Photo Guidelines ── */
.marv-photo-guidelines {
    background: #F8F9FB;
    border-left: 3px solid #93C847;
    padding: 20px 24px;
    border-radius: 0 0.25rem 0.25rem 0;
    margin-bottom: 24px;
}

.marv-photo-guidelines h4 {
    margin: 0 0 10px 0;
    color: #13294B;
    font-family: Helvetica, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
}

.marv-photo-guidelines ul {
    margin: 0;
    padding-left: 20px;
    color: #3C5575;
}

.marv-photo-guidelines li {
    margin-bottom: 6px;
    line-height: 1.6;
    font-size: 14px;
}

.marv-note {
    margin: 10px 0 0 0;
    font-size: 13px;
    color: #596F8B;
    font-style: italic;
}

/* ── Upload Zone ── */
.marv-upload-zone {
    border: 2px dashed #E1E5EB;
    border-radius: 0.25rem;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 24px;
    background: #F8F9FB;
}

.marv-upload-zone:hover,
.marv-upload-zone.drag-over {
    border-color: #93C847;
    background: rgba(147, 200, 71, 0.04);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(147, 200, 71, 0.08);
}

.marv-upload-zone svg {
    color: #93C847;
    margin-bottom: 12px;
}

.marv-upload-zone h4 {
    margin: 0 0 6px 0;
    font-family: Helvetica, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    color: #13294B;
    font-weight: 700;
}

.marv-upload-zone p {
    margin: 0;
    font-size: 14px;
    color: #596F8B;
}

/* ── Image Grid ── */
.marv-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.marv-image-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 0.25rem;
    overflow: hidden;
    border: 2px solid #E1E5EB;
    background: #F8F9FB;
    transition: border-color 0.2s ease;
}

.marv-image-card:hover {
    border-color: #93C847;
}

.marv-image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.marv-image-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s ease;
    backdrop-filter: blur(4px);
}

.marv-image-delete:hover {
    background: rgba(220, 38, 38, 0.9);
}

/* ── Validation Grid ── */
.marv-validation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}

.marv-validation-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.marv-validation-card.full-width {
    grid-column: 1 / -1;
}

.marv-validation-card label {
    font-size: 13px;
    font-weight: 600;
    color: #13294B;
}

.marv-validation-card textarea,
.marv-validation-card select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E1E5EB;
    border-radius: 0.25rem;
    font-size: 14px;
    font-family: inherit;
    color: #13294B;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.marv-validation-card textarea:focus,
.marv-validation-card select:focus {
    outline: none;
    border-color: #93C847;
    box-shadow: 0 0 0 4px rgba(147, 200, 71, 0.12);
}

/* ── Results Card ── */
.marv-results-card {
    border: 2px solid;
    border-radius: 0.25rem;
    overflow: hidden;
    margin-bottom: 28px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 24px rgba(0, 0, 0, 0.06);
}

.marv-results-header {
    padding: 32px 28px;
    color: white;
    text-align: center;
}

.marv-results-header h2 {
    margin: 0 0 12px 0;
    font-family: Helvetica, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.marv-confidence-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 18px;
    border-radius: 0.25rem;
    font-size: 13px;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.marv-price-box {
    text-align: center;
    padding: 28px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-bottom: 2px solid #86efac;
}

.marv-price-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #166534;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.marv-price-amount {
    font-family: Helvetica, 'Helvetica Neue', Arial, sans-serif;
    font-size: 44px;
    font-weight: 700;
    color: #15803d;
    line-height: 1;
    margin-bottom: 8px;
}

.marv-price-detail {
    font-size: 14px;
    color: #16a34a;
    font-weight: 600;
}

.marv-results-body {
    padding: 28px;
}

.marv-results-body h4 {
    margin: 0 0 14px 0;
    font-family: Helvetica, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #13294B;
}

.marv-results-list {
    margin: 0 0 20px 0;
    padding-left: 20px;
    list-style: none;
}

.marv-results-list li {
    margin-bottom: 10px;
    color: #3C5575;
    line-height: 1.6;
    padding-left: 20px;
    position: relative;
    font-size: 14px;
}

.marv-results-list li:before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: #93C847;
    font-weight: 700;
    font-size: 16px;
}

.marv-details-section {
    border-top: 1px solid #E1E5EB;
    padding-top: 20px;
}

.marv-details-section summary {
    cursor: pointer;
    font-weight: 600;
    color: #13294B;
    padding: 10px 12px;
    border-radius: 0.25rem;
    transition: background 0.2s ease;
    font-size: 14px;
}

.marv-details-section summary:hover {
    background: #F8F9FB;
}

.marv-details-content {
    padding: 16px 20px;
    background: #F8F9FB;
    border-radius: 0.25rem;
    margin-top: 10px;
}

.marv-details-content p {
    margin: 0 0 10px 0;
    color: #3C5575;
    line-height: 1.6;
    font-size: 14px;
}

.marv-details-content p:last-child {
    margin-bottom: 0;
}

/* ── Buttons ── */
.marv-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 28px;
}

.marv-form-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 1rem 2rem;
    border-radius: 0.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border: 2px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 52px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.marv-form-btn:active {
    transform: scale(0.97);
}

.marv-form-btn-primary {
    background: #13294B;
    color: white;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 4px 16px rgba(19, 41, 75, 0.2);
}

.marv-form-btn-primary:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.marv-form-btn-primary:disabled {
    background: #E1E5EB;
    color: #596F8B;
    cursor: not-allowed;
    box-shadow: none;
}

.marv-form-btn-secondary {
    background: #fff;
    color: #13294B;
    border: 2px solid #E1E5EB;
}

.marv-form-btn-secondary:hover {
    background: #F8F9FB;
    border-color: rgba(19, 41, 75, 0.3);
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* ── Loader Overlay ── */
.marv-form-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.marv-form-loader {
    background: white;
    padding: 40px 48px;
    border-radius: 0.25rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.marv-loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #E1E5EB;
    border-top-color: #93C847;
    border-radius: 50%;
    animation: marvSpin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes marvSpin {
    to { transform: rotate(360deg); }
}

.marv-form-loader p {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #13294B;
}

/* ── Customer Form ── */
.marv-customer-form {
    background: white;
    padding: 0;
    border-radius: 0.25rem;
}

.marv-customer-form .marv-form-row {
    margin-bottom: 16px;
}

.marv-customer-form .marv-form-row:last-of-type {
    margin-bottom: 0;
}

.marv-customer-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #13294B;
    margin-bottom: 6px;
}

.marv-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 400 !important;
    cursor: pointer;
    font-size: 14px;
    color: #3C5575;
}

.marv-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #13294B;
}

.marv-terms-link {
    background: none;
    border: none;
    color: #13294B;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    font-weight: 600;
    font-family: inherit;
    transition: color 0.2s ease;
}

.marv-terms-link:hover {
    color: #93C847;
}

/* ── Confirmation Card ── */
.marv-confirmation-card {
    background: white;
    border-radius: 0.25rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 24px rgba(0, 0, 0, 0.06);
}

.marv-confirmation-header {
    text-align: center;
    padding: 40px 28px 28px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-bottom: 2px solid #86efac;
}

.marv-confirmation-body {
    padding: 28px;
}

.marv-confirmation-section {
    margin-bottom: 24px;
}

.marv-confirmation-section:last-child {
    margin-bottom: 0;
}

.marv-confirmation-section h4 {
    margin: 0 0 12px 0;
    font-family: Helvetica, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #13294B;
}

.marv-confirmation-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 24px;
}

.marv-detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #E1E5EB;
}

.marv-detail-row:last-child {
    border-bottom: none;
}

.marv-detail-label {
    font-weight: 600;
    color: #596F8B;
    min-width: 120px;
    font-size: 13px;
}

.marv-detail-value {
    color: #13294B;
    flex: 1;
    font-size: 13px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .marv-form-container {
        padding: 0;
    }

    .marv-form-step-indicator {
        padding: 12px 4px 16px;
    }

    .marv-form-body {
        padding: 28px 20px;
    }

    .marv-form-step h3 {
        font-size: 1.5rem;
    }

    .marv-validation-grid {
        grid-template-columns: 1fr;
    }

    .marv-form-actions {
        flex-direction: column;
    }

    .marv-form-btn {
        width: 100%;
        justify-content: center;
    }

    .marv-results-header {
        padding: 24px 20px;
    }

    .marv-results-header h2 {
        font-size: 1.25rem;
    }

    .marv-price-amount {
        font-size: 36px;
    }

    .marv-image-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .marv-confirmation-header {
        padding: 28px 20px 20px;
    }

    .marv-confirmation-body {
        padding: 20px;
    }

    .marv-confirmation-actions {
        grid-template-columns: 1fr;
    }

    .marv-detail-row {
        flex-direction: column;
        gap: 2px;
    }

    .marv-detail-label {
        min-width: auto;
    }
}

/* ── Accessibility ── */
@media (prefers-reduced-motion: reduce) {
    .marv-form-step {
        animation: none;
    }

    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
