/* אפל סטייל - אתחול וטיפוגרפיה */
:root {
    --bg-page: #ffffff;
    --bg-container: #f5f5f7;
    --text-main: #1d1d1f;
    --text-secondary: #86868b;
    --accent-color: #0071e3;
    --accent-hover: #0077ED;
    --container-radius: 32px;
    --image-radius: 24px;
    --card-radius: 20px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;

    -webkit-font-smoothing: antialiased;
    padding: 20px;
}

/* מכולה רחבה ותחומה (Bounded) */
.guide-container {
    width: 100%;
    max-width: 1520px;
    background-color: var(--bg-container);
    border-radius: var(--container-radius);
    padding: 70px 100px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.02);
    min-height: 680px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: width 0.5s cubic-bezier(0.25, 1, 0.5, 1), padding 0.5s ease, min-height 0.5s ease;
}

/* מצב מצומצם - לתוכן קצר (למשל טופס יצירת קשר כשלא נמצא פילטר) */
.guide-container.compact {
    width: clamp(440px, 58vw, 875px);
    min-height: auto;
    padding: 56px 48px;
}

/* מסך בחירת מותג */
.brand-screen {
    text-align: center;
    animation: fadeIn 0.5s ease forwards;
}

.brand-screen h1 {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.brand-screen p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.brand-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.brand-card {
    background-color: #ffffff;
    border-radius: var(--card-radius);
    padding: 40px 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.01);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    flex: 1 1 180px;
    max-width: 220px;
}

.brand-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.04);
    border-color: rgba(0, 113, 227, 0.2);
}

.brand-logo-placeholder {
    width: 64px;
    height: 64px;
    background-color: var(--bg-container);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.brand-logo-placeholder img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.brand-card h3 {
    font-size: 20px;
    font-weight: 600;
}

/* מסך המדריך (מוסתר כברירת מחדל) */
.guide-screen {
    display: none;
    animation: fadeIn 0.5s ease forwards;
}

.slides-wrapper {
    position: relative;
    min-height: 520px;
    overflow: hidden;
}

/* מבנה הסליידר */
.slide {
    display: flex;
    align-items: center;
    gap: 80px;
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.98);
    transition: opacity 0.6s ease, transform 0.6s ease, visibility 0.6s;
}

.slide.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    position: relative;
}

/* חלוקת הצדדים */
.text-section {
    flex: 1.2;
    padding-left: 40px;
}

.photo-section {
    flex: 0.8;
    display: flex;
    justify-content: center;
}

/* טיפוגרפיה למדריך */
.step-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    display: block;
}

h2 {
    font-size: 38px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 22px;
    letter-spacing: -0.5px;
}

.slide p {
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-secondary);
    font-weight: 400;
}

/* מיצג הסמארטפון - מעודן וקטן */
.placeholder {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 9 / 19.5;
    background-color: #ffffff;
    border-radius: var(--image-radius);
    box-shadow: 0 12px 28px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    border: 8px solid #1d1d1f;
    overflow: hidden;
}

/* מסגרת קומפקטית למכשירים עם מסך קטן ורחב יחסית (למשל Qin F21 Pro, 3:4) */
.placeholder.frame-compact {
    max-width: 260px;
    aspect-ratio: 3 / 4;
    align-self: center;
}

.placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    cursor: zoom-in;
}

.img-zoom-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 22, 0.55);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    cursor: zoom-out;
    padding: 40px;
    animation: fadeIn 0.2s ease;
}

.img-zoom-overlay.active { display: flex; }

.img-zoom-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    cursor: default;
}

.img-zoom-close {
    position: absolute;
    top: 28px;
    left: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    color: var(--text-main);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.2s ease;
}

.img-zoom-close:hover { transform: scale(1.08); }

.placeholder span {
    padding: 24px;
}

/* כפתורי ניווט */
.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 40px;
    gap: 40px;
    position: relative;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 24px;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: rgba(0, 113, 227, 0.08);
    color: var(--accent-hover);
}

.nav-btn:disabled {
    color: #d2d2d7;
    cursor: not-allowed;
    background: none;
}

.back-to-brands-btn {
    position: absolute;
    right: 0;
    color: var(--text-secondary);
    font-size: 14px;
}
.back-to-brands-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-main);
}

/* נקודות הניווט (Dots) */
.dots {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #ffffff;
    padding: 8px 18px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #d2d2d7;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.dot.active {
    background-color: var(--text-main);
    width: 22px;
    border-radius: 8px;
}

/* אנימציות */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================ */
/* מסך התהליך (חיבור מכשיר / בדיקת פילטר / התקנה)                */
/* ============================================================ */

.app-shell {
    width: 100%;
    max-width: 1520px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.top-bar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.top-bar-actions .btn {
    font-size: 14px;
    padding: 10px 18px;
    white-space: nowrap;
}

.app-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main);
}

.app-logo-icon {
    width: 26px;
    height: 26px;
    display: block;
}

.app-logo span {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.app-logo .app-logo-tag {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-container);
    padding: 3px 12px;
    border-radius: 12px;
    margin-right: 4px;
}

.pipeline-stepper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-container);
    padding: 10px 20px;
    border-radius: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.step-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
}

.step-dot.active { background: var(--accent-color); color: #fff; }
.step-dot.completed { background: #1d1d1f; color: #fff; }

.step-line {
    width: 32px;
    height: 2px;
    background: #d2d2d7;
}

.page { display: none; }
.page.active { display: flex; }

.pipeline-page {
    justify-content: flex-start;
}

.pipeline-header p {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 4px;
}

.pipeline-body {
    flex: 1;
    overflow-y: auto;
    padding: 4px 4px 4px 0;
    margin: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-card {
    background: #ffffff;
    border-radius: var(--card-radius);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 15px;
    color: var(--text-main);
    box-shadow: 0 4px 12px rgba(0,0,0,0.01);
}

.info-card i { font-size: 22px; color: var(--accent-color); }

.list-item {
    background: #ffffff;
    border-radius: var(--card-radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 15px;
}

.list-item .icon { color: var(--accent-color); font-size: 18px; }

.action-area {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 20px;
}

.btn {
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 12px 26px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn:disabled { background: #d2d2d7; color: #86868b; cursor: not-allowed; transform: none; }

.btn-tonal {
    background: rgba(0, 113, 227, 0.08);
    color: var(--accent-color);
}
.btn-tonal:hover { background: rgba(0, 113, 227, 0.14); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color, rgba(0,0,0,0.1));
}
.btn-ghost:hover {
    background: var(--bg-container);
    color: var(--text-main);
    transform: none;
}

.btn-dark {
    background: #1d1d1f;
    color: #fff;
}
.btn-dark:hover { background: #000000; }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    background: var(--bg-container);
    color: var(--text-secondary);
}

.status-badge.success { color: #1e8449; background: rgba(46, 204, 113, 0.12); }
.status-badge.error { color: #c0392b; background: rgba(231, 76, 60, 0.1); }

/* צ'קליסט התקנה */
.install-steps {
    background: #ffffff;
    border-radius: var(--card-radius);
    padding: 8px 24px;
}

.install-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    opacity: 0.45;
    transition: opacity 0.3s ease;
}
.install-step:last-child { border-bottom: none; }
.install-step.is-active, .install-step.is-done, .install-step.is-error { opacity: 1; }

.install-step-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-container);
    color: var(--text-secondary);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.install-step.is-active .install-step-icon { background: var(--accent-color); color: #fff; }
.install-step.is-done .install-step-icon { background: #2ecc71; color: #fff; }
.install-step.is-error .install-step-icon { background: #e74c3c; color: #fff; }

.install-step-body { flex: 1; padding-top: 2px; }
.install-step-label { font-size: 15px; font-weight: 600; }
.install-step.is-error .install-step-label { color: #c0392b; }
.install-step-detail { font-size: 13px; color: var(--text-secondary); margin-top: 4px; line-height: 1.5; }
.install-step.is-error .install-step-detail { color: #c0392b; }

.progress-wrapper {
    width: 100%;
    background: var(--bg-container);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-hover));
    transition: width 0.3s ease;
}

.warning-box {
    border: 1px solid #f39c12;
    background: rgba(243, 156, 18, 0.06);
    padding: 18px 22px;
    border-radius: var(--card-radius);
    font-size: 14px;
    line-height: 1.6;
}
.warning-box strong { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: #b9770e; }
.warning-box-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.warning-box-actions .btn { font-size: 13px; padding: 8px 18px; }

.tech-log-details { font-size: 13px; color: var(--text-secondary); }
.tech-log-details summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.tech-log-details .muted-hint { font-weight: 400; opacity: 0.75; }

.terminal {
    background: #1d1d1f;
    color: #d2d2d7;
    border-radius: var(--card-radius);
    padding: 16px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    max-height: 220px;
    overflow-y: auto;
    margin: 10px 0;
}
.log-entry { margin-bottom: 4px; }
.log-entry.log-success { color: #2ecc71; }
.log-entry.log-error { color: #e74c3c; }
.log-entry.log-warn { color: #f39c12; }

.support-request-panel {
    margin-top: 8px;
    width: 100%;
    background: #ffffff;
    border-radius: var(--card-radius);
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.01);
    border: 1px solid rgba(0,0,0,0.03);
}
.support-form-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}
.support-form-header i {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 113, 227, 0.08);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.support-form-title { font-size: 16px; font-weight: 600; }
.support-form-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
.text-input {
    border: 1px solid rgba(0,0,0,0.12);
    background: var(--bg-container);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}
.text-input::placeholder { color: var(--text-secondary); }
.text-input:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}
.text-input.full-width { grid-column: 1 / -1; }
textarea.text-input { grid-column: 1 / -1; min-height: 60px; resize: vertical; }

.support-request-result {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 12px;
}
.support-request-result.success { color: #1e8449; background: rgba(46, 204, 113, 0.12); }
.support-request-result.error { color: #c0392b; background: rgba(231, 76, 60, 0.1); }

.success-page {
    text-align: center;
    align-items: center;
}

.success-icon {
    font-size: 72px;
    color: #2ecc71;
    margin-bottom: 24px;
    animation: popIn 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.success-page h2 { margin-bottom: 14px; }

.success-page p {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 440px;
    margin: 0 auto 32px;
}

@keyframes popIn {
    from { transform: scale(0.6); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.compat-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: var(--bg-page);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}
.compat-overlay i { font-size: 60px; color: var(--accent-color); margin-bottom: 20px; }
.compat-overlay p { color: var(--text-secondary); max-width: 420px; margin-top: 10px; }

#snackbar {
    visibility: hidden;
    min-width: 260px;
    background-color: #1d1d1f;
    color: #fff;
    text-align: center;
    border-radius: 20px;
    padding: 14px 24px;
    position: fixed;
    z-index: 1000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 14px;
}
#snackbar.show {
    visibility: visible;
    animation: fadein 0.4s, fadeout 0.4s 2.6s;
}
@keyframes fadein { from { opacity: 0; bottom: 0; } to { opacity: 1; bottom: 30px; } }
@keyframes fadeout { from { opacity: 1; bottom: 30px; } to { opacity: 0; bottom: 0; } }

/* כפתור צף לפנייה לתמיכה, זמין בכל שלב */
.help-fab {
    position: fixed;
    bottom: 28px;
   inset-inline-end: 28px;
    z-index: 1500;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #1d1d1f;
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 14px 22px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.help-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.22);
}

/* דיאלוג פנייה לתמיכה */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 22, 0.55);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
.modal-overlay.active { display: flex; }

.modal-box {
    position: relative;
    width: 100%;
    max-width: 640px;
    background: var(--bg-container);
    border-radius: var(--card-radius);
    padding: 48px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.modal-box .support-form-header i {
    width: 52px;
    height: 52px;
    font-size: 20px;
}

.modal-box .support-form-title { font-size: 20px; }
.modal-box .support-form-subtitle { font-size: 15px; }

.modal-box .text-input {
    font-size: 16px;
    padding: 14px 18px;
}

.modal-box textarea.text-input { min-height: 90px; }

.modal-box .support-request-result { font-size: 15px; }

.modal-box .btn {
    font-size: 16px;
    padding: 14px 30px;
}

.modal-close {
    position: absolute;
    top: 16px;
    left: 16px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
}
