/* Fabio Frontend - Scoped Styles */

/* Button */
.fabio-vinde-btn {
    background: #248df6;
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1.5;
    display: inline-block;
}
.fabio-vinde-btn:hover {
    background: #1a7ae0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(36, 141, 246, 0.35);
}

/* Overlay */
.fabio-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px);
    animation: fabioFadeIn 0.2s ease;
}
@keyframes fabioFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fabioSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.fabio-modal-container {
    animation: fabioSlideUp 0.3s ease;
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Mobile full-screen */
@media (max-width: 639px) {
    .fabio-modal-overlay { padding: 0; align-items: stretch; }
    .fabio-modal-container { height: 100%; }
    .fabio-modal-wrap { border-radius: 0 !important; max-width: 100% !important; max-height: 100% !important; height: 100%; }
    .fabio-hide-mobile { display: none !important; }
    .fabio-form-row { grid-template-columns: 1fr; }
}

/* ================================================
   MODAL WRAP - all styles scoped to this container
   ================================================ */
.fabio-modal-wrap {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1f2937;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
}
.fabio-modal-wrap *, .fabio-modal-wrap *::before, .fabio-modal-wrap *::after {
    box-sizing: border-box;
}

/* Header */
.fabio-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.fabio-modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #1f2937;
}
.fabio-modal-close {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fabio-modal-close:hover { background: #f3f4f6; }

/* Breadcrumb */
.fabio-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.fabio-step-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}
.fabio-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}
.fabio-step-number.active {
    background: #248df6;
    color: #fff;
}
.fabio-step-number.inactive {
    background: #d1d5db;
    color: #6b7280;
}
.fabio-step-label {
    font-size: 13px;
    font-weight: 500;
}
.fabio-step-label.active { color: #374151; }
.fabio-step-label.inactive { color: #9ca3af; }
.fabio-breadcrumb-line {
    width: 32px;
    height: 1px;
    background: #d1d5db;
}

/* Content area */
.fabio-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}
.fabio-modal-body::-webkit-scrollbar { width: 6px; }
.fabio-modal-body::-webkit-scrollbar-track { background: transparent; }
.fabio-modal-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* Footer */
.fabio-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0;
}
.fabio-btn-back {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
}
.fabio-btn-back:hover { background: #f3f4f6; }
.fabio-btn-primary {
    padding: 8px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background: #248df6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-left: auto;
}
.fabio-btn-primary:hover { background: #1a7ae0; }

/* Step content */
.fabio-step { animation: fabioFadeIn 0.25s ease; }

/* Step 1: How it works */
.fabio-how-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.fabio-how-item { display: flex; align-items: flex-start; gap: 12px; }
.fabio-how-num {
    flex-shrink: 0;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #dbeafe;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600; color: #2563eb;
}
.fabio-how-text strong { display: block; font-size: 14px; color: #374151; font-weight: 500; }
.fabio-how-text span { font-size: 12px; color: #6b7280; }
.fabio-products-grid {
    display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.fabio-product-icon {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 12px; background: #f3f4f6; border-radius: 12px; min-width: 80px;
}
.fabio-product-icon svg { width: 28px; height: 28px; color: #248df6; }
.fabio-product-icon span { font-size: 11px; color: #4b5563; }

/* Form elements */
.fabio-form-group { margin-bottom: 16px; }
.fabio-form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}
.fabio-form-input,
.fabio-form-select,
.fabio-form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #1f2937;
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.fabio-form-input:focus,
.fabio-form-select:focus,
.fabio-form-textarea:focus {
    border-color: #248df6;
    box-shadow: 0 0 0 3px rgba(36, 141, 246, 0.15);
}
.fabio-form-textarea { resize: none; }
.fabio-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fabio-field-error {
    font-size: 12px;
    color: #ef4444;
    margin-top: 4px;
}
.fabio-consent-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 8px;
}
.fabio-consent-row input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; }
.fabio-consent-row label { font-size: 12px; color: #4b5563; }
.fabio-consent-row a { color: #248df6; text-decoration: underline; }

/* Upload area */
.fabio-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}
.fabio-upload-area:hover { border-color: #248df6; }
.fabio-upload-area svg { width: 32px; height: 32px; color: #9ca3af; margin: 0 auto 8px; display: block; }
.fabio-upload-area p { margin: 0; }
.fabio-upload-area .fabio-upload-main { font-size: 14px; color: #6b7280; }
.fabio-upload-area .fabio-upload-hint { font-size: 12px; color: #9ca3af; margin-top: 4px; }

/* File preview */
.fabio-file-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fabio-file-thumb {
    position: relative;
    width: 80px; height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    flex-shrink: 0;
}
.fabio-file-thumb img, .fabio-file-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.fabio-remove-file {
    position: absolute; top: 2px; right: 2px;
    width: 20px; height: 20px;
    background: rgba(239, 68, 68, 0.9);
    color: #fff; border: none; border-radius: 50%;
    font-size: 14px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center; padding: 0;
}
.fabio-upload-progress {
    position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: #e5e7eb;
}
.fabio-upload-progress-bar { height: 100%; background: #248df6; transition: width 0.3s; width: 0%; }

/* Confirmation */
.fabio-confirm { text-align: center; padding: 8px 0; }
.fabio-confirm-icon {
    width: 64px; height: 64px; border-radius: 50%;
    background: #d1fae5; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
}
.fabio-confirm-icon svg { width: 32px; height: 32px; color: #059669; }
.fabio-confirm h3 { font-size: 18px; font-weight: 600; margin: 0 0 8px; }
.fabio-confirm-id { color: #248df6; font-weight: 600; }
.fabio-confirm-steps {
    background: #f3f4f6; border-radius: 12px; padding: 16px; text-align: left; margin-top: 16px;
}
.fabio-confirm-steps h4 { font-size: 14px; font-weight: 600; margin: 0 0 12px; color: #374151; }
.fabio-confirm-step-item { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.fabio-confirm-step-item svg { width: 16px; height: 16px; color: #248df6; flex-shrink: 0; margin-top: 1px; }
.fabio-confirm-step-item p { margin: 0; font-size: 12px; color: #4b5563; }
.fabio-confirm-link { font-size: 12px; color: #6b7280; margin-top: 16px; }
.fabio-confirm-link a { color: #248df6; text-decoration: underline; }

/* Spinner */
.fabio-spinner {
    width: 32px; height: 32px;
    border: 3px solid #e5e7eb; border-top-color: #248df6;
    border-radius: 50%;
    animation: fabioSpin 0.6s linear infinite;
}
@keyframes fabioSpin { to { transform: rotate(360deg); } }

/* Loading overlay */
.fabio-loading-overlay {
    position: absolute; inset: 0;
    background: rgba(255,255,255,0.85);
    display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px;
    z-index: 50;
}
.fabio-loading-overlay p { margin: 0; font-size: 14px; color: #6b7280; }

/* Section label */
.fabio-section-title {
    font-size: 15px; font-weight: 600; color: #1f2937; margin: 0 0 16px;
}
.fabio-section-subtitle {
    font-size: 13px; font-weight: 600; color: #374151; margin: 0 0 12px;
}
