/* הפלטה של nutricook: כתום על נייטרלים קרים. שמות המשתנים זהים במבנה
   ל-Gaggia/Melitta כדי ששאר הגיליון יישאר בר-השוואה ביניהם. */
:root {
  --nc-orange: #f0562a;
  --nc-orange-dark: #c8431c;
  --text-dark: #14100e;
  --text-brown: #43413f;
  --text-muted: #86807b;
  --bg-cream: #f7f6f5;
  --bg-white: #ffffff;
  --border-light: #e4e1de;
  --gold-accent: #f0562a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, "Segoe UI", sans-serif;
  background: var(--bg-cream);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
}

/* ===== גרסת דסקטופ: מיכל רחב ומרווח ===== */
.app-shell {
  width: 100%;
  max-width: 1080px;
  background: var(--bg-white);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(26, 15, 8, 0.10);
  border: 1px solid var(--border-light);
  padding: 44px 56px 52px;
  position: relative;
}

/* לקובץ הלוגו יש שוליים לבנים מובנים - הגובה הקבוע + overflow קוצצים אותם */
.brand-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  height: 63px;
  overflow: hidden;
  margin-bottom: 18px;
}

.brand-logo {
  width: 175px;
  max-width: 100%;
  height: auto;
}

/* לוגו מותג משני בכותרת - ממודד לפי גובה כדי לשבת לצד לוגו המילטון */
.brand-header .brand-logo--secondary {
  width: auto;
  height: 40px;
}

.progress-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--border-light);
  transition: background 0.25s ease;
}

.dot.active {
  background: var(--nc-orange);
}

.screen {
  display: none;
  animation: fade-in 0.3s ease;
}

.screen.active {
  display: block;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen-header {
  text-align: center;
  margin-bottom: 36px;
}

.screen-header h1 {
  font-size: 2rem;
  color: var(--text-dark);
  margin: 0 0 10px;
}

.screen-header p {
  color: var(--text-muted);
  margin: 0;
  font-size: 1.05rem;
}

/* ===== טופס: שתי עמודות בדסקטופ ===== */
.details-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 28px;
  max-width: 820px;
  margin: 0 auto;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0; /* מאפשר לשדות להצטמצם בתוך תא ה-grid */
}

/* שדות שנפרסים על כל הרוחב (חשבונית, כפתורים) */
.field-group--full,
.details-form .form-actions {
  grid-column: 1 / -1;
}

.field-group label {
  font-size: 0.95rem;
  color: var(--text-brown);
  font-weight: 600;
}

.field-group input {
  width: 100%;
  min-width: 0; /* מונע גלישה של input[type=file] שרוחבו המובנה גדול מהתא */
  padding: 13px 16px;
  border: 1.5px solid var(--border-light);
  border-radius: 6px;
  font-size: 1rem;
  background: var(--bg-white);
  outline: none;
  transition: border-color 0.2s ease;
}

.field-group input:focus {
  border-color: var(--nc-orange);
}

.field-group input.invalid {
  border-color: var(--nc-orange);
}

.error-msg {
  color: var(--nc-orange);
  font-size: 0.82rem;
  min-height: 1em;
}

/* שגיאת שליחה: הודעה ברוחב מלא מעל כפתור האישור, לא ליד שדה בודד */
.error-msg--submit {
  display: block;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
}

/* בורר רשת שיווק */
/* auto-fit ולא מספר עמודות קבוע: הוספת רשת ל-stores.json לא תדרוש שוב
   עריכת CSS, כפי שקרה כשנוספה הרשת השישית. */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
}

.store-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 64px;
  padding: 10px 8px;
  background: var(--bg-white);
  border: 1.5px solid var(--border-light);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.store-logo {
  max-width: 100%;
  max-height: 34px;
  object-fit: contain;
}

.store-tile:hover {
  transform: translateY(-2px);
  border-color: var(--gold-accent);
}

.store-tile.selected {
  border-color: var(--nc-orange);
  box-shadow: 0 6px 16px rgba(193, 39, 45, 0.18);
  background: var(--bg-cream);
}

.store-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.store-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-brown);
  text-align: center;
}

.store-other-input {
  width: 100%;
  min-width: 0;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border-light);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
}

.store-other-input:focus {
  border-color: var(--nc-orange);
}

@media (max-width: 900px) {
  /* 4 עמודות ל-7 רשתות => 4+3. עם 3 עמודות נוצרה שורה שלישית עם אריח יתום. */
  .store-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 560px) {
  .store-grid { grid-template-columns: repeat(2, 1fr); }
  .store-name { font-size: 0.72rem; }
}

.file-hint {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.field-group input[type="file"] {
  padding: 11px 14px;
  font-size: 0.9rem;
  background: var(--bg-cream);
  cursor: pointer;
}

/* ===== כפתורים: ממורכזים ולא נמתחים לכל הרוחב ===== */
.form-actions {
  display: flex;
  gap: 14px;
  margin-top: 16px;
  justify-content: center;
}

.primary-button, .secondary-button {
  flex: 0 1 240px;
  padding: 14px 28px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease, transform 0.1s ease;
}

.primary-button {
  background: var(--nc-orange);
  color: var(--bg-white);
}

.primary-button:not(:disabled):hover {
  background: var(--nc-orange-dark);
}

.primary-button:disabled {
  background: var(--border-light);
  color: var(--text-muted);
  cursor: not-allowed;
}

.primary-button:not(:disabled):active {
  transform: scale(0.98);
}

.secondary-button {
  background: var(--bg-cream);
  color: var(--text-brown);
  border: 1.5px solid var(--border-light);
}

.secondary-button:hover {
  border-color: var(--gold-accent);
}

.secondary-button:active {
  transform: scale(0.98);
}

/* ===== ההצעה: מוצר + מתנה =====
   בקמפיין הזה אין בחירה, ולכן אין מצב selected ואין cursor:pointer -
   הכרטיסים הם תצוגה בלבד. סימון לחיצות על משהו שאינו לחיץ הוא הבטחה
   שהדף לא מקיים. */
.offer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: 4px 0 8px;
  margin-bottom: 20px;
}

.offer-plus {
  font-size: 2.2rem;
  font-weight: bold;
  color: var(--nc-orange);
  line-height: 1;
  /* במובייל ה-grid הופך לעמודה אחת, והתא נמתח לכל הרוחב. בלי המרכוז
     הזה ה-"+" נצמד לימין (RTL) ונראה כמו תקלה ולא כמו מפריד. */
  text-align: center;
}

.machine-card, .gift-card {
  background: var(--bg-white);
  border: 2px solid var(--border-light);
  border-radius: 10px;
  padding: 22px 16px 24px;
  text-align: center;
}

/* המתנה היא הסיבה שהלקוח כאן - מסגרת כתומה מסמנת אותה בלי טקסט נוסף */
.gift-card {
  border-color: var(--nc-orange);
  background: linear-gradient(180deg, #fff7f4 0%, var(--bg-white) 60%);
}

.machine-card-image, .gift-card-image {
  width: 70%;
  aspect-ratio: 1;
  object-fit: contain;
  margin-bottom: 10px;
}

.machine-card-icon, .gift-icon {
  font-size: 3rem;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.machine-card h3, .gift-card h3 {
  font-size: 1.05rem;
  margin: 0 0 8px;
  color: var(--text-dark);
}

.machine-card p, .gift-card p {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 0;
}

/* ===== מסך אישור ===== */
.confirm-panel {
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
}

.confirm-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

.confirm-details {
  background: var(--bg-cream);
  border-radius: 10px;
  padding: 22px 28px;
  margin: 26px 0;
  text-align: right;
  border: 1px solid var(--border-light);
}

.confirm-details div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  font-size: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.confirm-details div:last-child {
  border-bottom: none;
}

.confirm-details dt {
  color: var(--text-muted);
}

.confirm-details dd {
  margin: 0;
  font-weight: 600;
  color: var(--text-dark);
  overflow-wrap: anywhere;
}

/* ===== התאמה למסכים בינוניים (טאבלט) ===== */
@media (max-width: 900px) {
  body { padding: 32px 20px; }

  .app-shell {
    padding: 32px 28px 36px;
  }

  .screen-header h1 { font-size: 1.6rem; }

  .details-form {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ===== התאמה למסכים קטנים (מובייל) ===== */
@media (max-width: 560px) {
  body { padding: 20px 12px; }

  .app-shell {
    padding: 24px 18px 30px;
    border-radius: 12px;
  }

  .brand-header { height: 49px; gap: 14px; }
  .brand-logo { width: 133px; }
  .brand-header .brand-logo--secondary { height: 30px; }

  .screen-header { margin-bottom: 24px; }
  .screen-header h1 { font-size: 1.35rem; }
  .screen-header p { font-size: 0.95rem; }

  /* המוצר והמתנה זה מעל זה, ו-"+" הופך לשורה משלו במרכז */
  .offer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .machine-card, .gift-card { padding: 16px 12px 18px; }
  .machine-card h3, .gift-card h3 { font-size: 0.95rem; }
  .machine-card p, .gift-card p { font-size: 0.78rem; }

  .form-actions { flex-direction: column-reverse; }
  .primary-button, .secondary-button { flex: 1 1 auto; width: 100%; }

  /* מונע זום אוטומטי ב-iOS Safari - שדה קלט מתחת ל-16px גורם להגדלה בפוקוס */
  .field-group input,
  .field-group input[type="file"] {
    font-size: 16px;
  }

  /* פרטי האישור: תווית מעל הערך, כדי שערכים ארוכים (אימייל) לא יגלשו מהתיבה */
  .confirm-details {
    padding: 16px 18px;
  }

  .confirm-details div {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 9px 0;
    font-size: 0.95rem;
  }
}

/* ===== תיבות אישור: תקנון (חובה) ודיוור (רשות) =====
   בתוך מסגרת אחת, כמו בדף של Melitta, כדי ששתיהן ייקראו כיחידה אחת
   בסוף הטופס ולא ייעלמו בין השדות. */
.consent-group {
  margin-top: 4px;
  gap: 10px;
  padding: 14px 16px;
  border: 1.5px solid var(--border-light);
  border-radius: 8px;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: normal;
  line-height: 1.5;
  color: var(--text-muted);
  cursor: pointer;
}

.consent-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 2px;
  accent-color: var(--nc-orange);
  cursor: pointer;
}

/* ===== תנאי המבצע ===== */
.campaign-terms {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.campaign-terms p {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ===== שער התצורה =====
   מופיע רק אם מק״ט או כתובת ה-webhook עדיין placeholder. בכוונה צעקני:
   הוא קיים כדי שדף חצי-מוגדר לא יגיע לאוויר בשקט. */
.config-banner {
  background: #7a1200;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: bold;
  line-height: 1.5;
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
}

/* קישורי התקנון והפרטיות - מודגשים בתוך משפט אפרפר, כדי שיהיה ברור
   שיש מה ללחוץ עליו לפני שמאשרים. */
.consent-label a {
  color: var(--nc-orange);
  font-weight: bold;
  text-decoration: underline;
}

.consent-label a:hover {
  color: var(--nc-orange-dark);
}

/* הערת מסך התודה. מסך זה הוא התיעוד היחיד שהלקוח מקבל כל עוד מייל
   האישור לא מגיע, ולכן ההערה בולטת מספיק כדי להיקרא ולא מספיק כדי
   להתחרות בפרטי ההרשמה עצמם. */
.confirm-note {
  margin: 18px auto 22px;
  max-width: 420px;
  padding: 12px 16px;
  background: var(--bg-cream);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text-brown);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* ===== דף התקנון =====
   מיכל צר יותר מהטופס: שורת טקסט ארוכה מדי קשה לקריאה, ותקנון הוא
   מסמך שקוראים ולא טופס שממלאים. */
.app-shell--doc {
  max-width: 780px;
}

.doc {
  color: var(--text-dark);
  line-height: 1.7;
  font-size: 0.95rem;
}

.doc h1 {
  font-size: 1.45rem;
  line-height: 1.4;
  margin: 0 0 24px;
}

.doc h2 {
  font-size: 1.1rem;
  margin: 28px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--nc-orange);
}

.doc p { margin: 0 0 12px; }

.doc-list {
  margin: 0 0 12px;
  padding-inline-start: 22px;
}

.doc-list li { margin-bottom: 10px; }

/* הגדרות: המונח מודגש מעל ההסבר, ולא בטבלה - טבלאות שתי-עמודות
   נשברות בצורה מכוערת במובייל. */
.doc-defs { margin: 0; }

.doc-defs dt {
  font-weight: bold;
  color: var(--nc-orange-dark);
  margin-top: 14px;
}

.doc-defs dd {
  margin: 2px 0 0;
  padding-inline-start: 0;
}

.doc-back {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.doc-back a {
  color: var(--nc-orange);
  font-weight: bold;
  text-decoration: none;
}

/* פרטי החברה מתחת לשורת התנאים - נדרשים בתקנון וטוב שיהיו גלויים */
.campaign-terms-company {
  margin: 6px 0 0;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.campaign-terms a {
  color: var(--text-muted);
  text-decoration: underline;
}
