/* ============================================================
   פאי גז - אפליקציית ווב (PWA)
   סגנון כללי: RTL, mobile-first, מראה זהה לאפליקציית Flutter
   ============================================================ */

:root {
  --main-color: #002966;      /* Constants.textMainColor */
  --nav-color: #0D47A1;       /* Colors.blue[900] */
  --error-color: #B71C1C;     /* Colors.red[800] */
  --ok-color: #1B5E20;
  --radius: 8px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", Arial, "Helvetica Neue", sans-serif;
  color: var(--main-color);
  background: #072a5e;
  direction: rtl;
  padding-bottom: 72px;               /* מקום לתפריט התחתון */
  -webkit-text-size-adjust: 100%;
}

/* רקע המסך - אותה תמונה מהאפליקציה */
.bg {
  position: fixed;
  inset: 0;
  background-image: url("assets/images/bg.png");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: -1;
}

.hidden { display: none !important; }

/* ===================== מסכים ===================== */
.screen {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 14px 24px;
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 72px);
}

.logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 0 4px;
}

.logo {
  max-width: 200px;
  width: 60%;
  height: auto;
  object-fit: contain;
}

.logo-wrap.small { padding: 4px 0; }
.logo-wrap.small .logo { max-width: 150px; }

/* ===================== שדות טופס ===================== */
.field { margin-bottom: 14px; }

.field input {
  width: 100%;
  padding: 14px 12px;
  font-size: 20px;
  font-family: inherit;
  color: var(--main-color);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 41, 102, 0.55);
  border-radius: var(--radius);
  text-align: right;
  outline: none;
  appearance: none;
}

.field input::placeholder { color: #5b6b86; }

.field input:focus {
  border-color: var(--main-color);
  box-shadow: 0 0 0 2px rgba(0, 41, 102, 0.18);
}

.field input.invalid { border-color: var(--error-color); }

.field-error {
  min-height: 18px;
  padding: 2px 4px 0;
  font-size: 13px;
  color: var(--error-color);
  text-align: right;
}

/* ===================== כפתור ראשי (כמו באפליקציה) ===================== */
.btn-wrap {
  display: flex;
  justify-content: center;
  margin: 18px 0 8px;
  min-height: 120px;
}

.main-btn {
  position: relative;
  width: 170px;
  height: 170px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.main-btn img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
}

.main-btn-text {
  position: relative;
  z-index: 1;
  margin-top: 42px;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.main-btn:active { transform: scale(0.97); }
.main-btn[disabled] { opacity: 0.65; cursor: default; }
.main-btn.sent img { width: 88%; height: auto; margin: 0 auto; }

/* ===================== מידע משתמש ===================== */
.user-info { padding: 6px 6px 10px; }

.user-line {
  font-size: 18px;
  color: var(--main-color);
  text-align: right;
  padding: 2px 0;
}

/* ===================== צ'קבוקסים ===================== */
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  cursor: pointer;
}

.check-row input {
  width: 24px;
  height: 24px;
  accent-color: var(--nav-color);
  flex: 0 0 auto;
}

.check-row span {
  font-size: 18px;
  font-weight: 700;
  color: var(--main-color);
}

.form-hint {
  min-height: 24px;
  padding: 6px 6px 0;
  font-size: 15px;
  color: var(--error-color);
  text-align: right;
}

/* ===================== מצבי הצלחה / שגיאה ===================== */
.sent-img {
  display: block;
  max-width: 90%;
  max-height: 130px;
  object-fit: contain;
  margin: 10px auto;
}

.sent-text {
  font-size: 17px;
  line-height: 1.6;
  text-align: center;
  color: var(--ok-color);
  padding: 6px 4px;
}

.sent-text.error-text { color: var(--error-color); }

.sent-ref {
  text-align: center;
  font-size: 14px;
  color: var(--main-color);
  padding: 4px 0 10px;
  direction: ltr;
}

.logout-row { margin-top: auto; text-align: left; padding: 12px 4px 0; }

.link-btn {
  background: none;
  border: 0;
  color: var(--main-color);
  font: inherit;
  font-size: 15px;
  text-decoration: underline;
  cursor: pointer;
  padding: 6px 2px;
}

.link-btn.small {
  font-size: 13px;
  opacity: 0.85;
  padding: 2px 0;
}

.user-info .link-btn { display: block; margin-top: 2px; }

/* כפתורי פעולה במסך שגיאה (נסה שוב / חזרה) */
.error-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 0 8px;
}

.action-btn {
  width: 100%;
  max-width: 300px;
  padding: 14px 18px;
  border: 0;
  border-radius: var(--radius);
  background: var(--nav-color);
  color: #ffffff;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.action-btn:active { transform: scale(0.98); }
.action-btn[disabled] { opacity: 0.6; cursor: default; }

.install-row { text-align: right; padding: 2px 4px 0; }

.version { font-size: 11px; color: #16365c; padding: 8px 4px 0; text-align: left; }

/* ===================== תפריט תחתון ===================== */
.bottom-bar {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  height: 64px;
  display: flex;
  background: var(--nav-color);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
  z-index: 20;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-bar button {
  flex: 1;
  border: 0;
  background: transparent;
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  height: 64px;
}

.bottom-bar svg { width: 24px; height: 24px; fill: #ffffff; }
.bottom-bar button:active { background: rgba(255, 255, 255, 0.12); }

/* ===================== חלונות קופצים ===================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 40;
}

.modal-box {
  background: #ffffff;
  border-radius: 14px;
  width: 100%;
  max-width: 420px;
  max-height: 86dvh;
  padding: 18px 16px 14px;
  display: flex;
  flex-direction: column;
  text-align: right;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.modal-box h2 {
  margin: 0 0 10px;
  font-size: 21px;
  text-align: center;
  color: var(--main-color);
}

.modal-logo {
  display: block;
  width: 96px;
  margin: -46px auto 6px;
  background: #ffffff;
  border-radius: 50%;
  padding: 4px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.modal-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 15px;
  line-height: 1.65;
  color: #1b1b1b;
}

.modal-scroll p { margin: 0 0 10px; }
.modal-scroll ol { padding-inline-start: 22px; margin: 0 0 10px; }
.modal-scroll li { margin-bottom: 6px; }
.modal-scroll .note { font-size: 13px; color: #7a1f1f; }
.modal-banner { width: 100%; max-width: 300px; display: block; margin: 8px auto 0; }

.modal-close {
  margin-top: 12px;
  padding: 12px;
  border: 0;
  border-radius: var(--radius);
  background: var(--nav-color);
  color: #ffffff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

.modal-box .check-row {
  background: transparent;
  padding: 6px 0;
  margin-bottom: 0;
}

.modal-box .check-row span {
  font-size: 14px;
  font-weight: 400;
  color: #333;
}

.modal-box ul { padding-inline-start: 20px; margin: 0 0 8px; }
.modal-box li { margin-bottom: 4px; }

/* ===================== Toast ===================== */
.toast {
  position: fixed;
  bottom: 84px;
  right: 50%;
  transform: translateX(50%);
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  font-size: 15px;
  padding: 10px 18px;
  border-radius: 22px;
  z-index: 50;
  max-width: 90vw;
  text-align: center;
}

/* ===================== מסך גדול ===================== */
@media (min-width: 700px) {
  .screen { padding-top: 28px; }
  .main-btn { width: 180px; height: 180px; }
}
