:root {
  --frame-primary: #0065d1;
  --frame-primary-hover: #004fa3;
  --frame-error: #b71a34;
  --frame-bg: #f8f9fa;
  --frame-card-bg: #fff;
  --frame-text: #333;
  --frame-muted: #666;
  --frame-border: #e0e0e0;
  --frame-font: inherit;
  --frame-radius: 12px;
  --frame-shadow: 0 2px 12px rgba(0,0,0,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.frame-page {
  background: var(--frame-bg);
  font-family: var(--frame-font);
  direction: rtl;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

/* ── Container & Card ─────────────────────────── */
.frame-container { width: 100%; max-width: 400px; }
.frame-card {
  background: var(--frame-card-bg);
  border-radius: var(--frame-radius);
  box-shadow: var(--frame-shadow);
  padding: 2rem 1.5rem;
  position: relative;
  overflow: hidden;
}

/* ── Loader ───────────────────────────────────── */
.frame-loader {
  position: absolute; inset: 0;
  background: rgba(255,255,255,.92);
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.frame-loader span {
  width: 40px; height: 40px;
  border: 4px solid var(--frame-border);
  border-top-color: var(--frame-primary);
  border-radius: 50%;
  animation: frame-spin .7s linear infinite;
}
@keyframes frame-spin { to { transform: rotate(360deg); } }

/* ── Header ───────────────────────────────────── */
.frame-header { text-align: center; margin-bottom: 1.5rem; position: relative; }
.frame-logo { max-height: 48px; width: auto; }
.frame-back {
  position: absolute; top: 0; left: 0;
  background: none; border: none; cursor: pointer;
  color: var(--frame-primary); padding: 4px;
}

/* ── Steps ────────────────────────────────────── */
.frame-step h2 { font-size: 1.1rem; margin-bottom: .4rem; color: var(--frame-text); }
.frame-hint  { font-size: .82rem; color: var(--frame-muted); margin-bottom: 1.2rem; line-height: 1.6; }
.frame-step input[type="tel"],
.frame-step input[type="text"] {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--frame-border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: var(--frame-font);
  direction: rtl;
  transition: border-color .2s;
  outline: none;
}
.frame-step input:focus { border-color: var(--frame-primary); }
.frame-step input.text-center { text-align: center; letter-spacing: .3em; direction: ltr; }

/* ── Buttons ──────────────────────────────────── */
.frame-btn-primary,
.frame-btn-secondary {
  width: 100%; padding: .75rem; border: none; border-radius: 8px;
  font-size: .95rem; font-weight: 600; cursor: pointer; margin-top: .75rem;
  font-family: var(--frame-font); transition: background .2s, opacity .2s;
}
.frame-btn-primary   { background: var(--frame-primary); color: #fff; }
.frame-btn-primary:hover { background: var(--frame-primary-hover); }
.frame-btn-secondary { background: transparent; color: var(--frame-muted); border: 1.5px solid var(--frame-border); }
.frame-btn-secondary:hover:not(:disabled) { background: var(--frame-bg); }
.frame-btn-secondary:disabled { opacity: .5; cursor: not-allowed; }

/* ── Error ────────────────────────────────────── */
.frame-error { color: var(--frame-error); font-size: .78rem; min-height: 1.2em; margin-top: .4rem; }

/* ── Modal ────────────────────────────────────── */
.frame-modal-overlay {
  position: fixed; inset: 0; z-index: 99998;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.frame-modal {
  background: var(--frame-card-bg);
  border-radius: var(--frame-radius);
  box-shadow: var(--frame-shadow);
  padding: 2rem 1.5rem;
  width: 100%; max-width: 400px;
  position: relative;
}
.frame-modal-close {
  position: absolute; top: 12px; left: 12px;
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; color: var(--frame-muted);
}

/* ── Floating Button ──────────────────────────── */
.frame-float-btn {
  position: fixed; z-index: 99997;
  background: var(--frame-primary); color: #fff;
  border: none; border-radius: 50px;
  padding: 12px 20px; font-size: .9rem; font-weight: 600;
  cursor: pointer; font-family: var(--frame-font);
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  display: flex; align-items: center; gap: 6px;
  transition: transform .2s, background .2s;
}
.frame-float-btn:hover { background: var(--frame-primary-hover); transform: translateY(-2px); }
.frame-float-bottom-right { bottom: 24px; right: 24px; }
.frame-float-bottom-left  { bottom: 24px; left:  24px; }
.frame-float-top-right    { top:    24px; right:  24px; }
.frame-float-top-left     { top:    24px; left:   24px; }

/* ── Admin Settings ───────────────────────────── */
.frame-field { margin-bottom: 1.2rem; }
.frame-field label,
.frame-field .description { font-size: .85rem; color: var(--frame-muted); margin-top: .3rem; display: block; }
.frame-field select,
.frame-field input[type="text"],
.frame-field textarea {
  width: 100%; padding: .5rem .7rem;
  border: 1px solid var(--frame-border); border-radius: 6px;
  font-family: var(--frame-font); font-size: .9rem;
}
.frame-field input[type="text"].ltr,
.frame-field textarea.ltr { direction: ltr; text-align: left; }

/* ── Blocks Page ──────────────────────────────── */
.frame-blocks-wrap { max-width: 900px; margin: 1.5rem auto; direction: rtl; font-family: var(--frame-font); }
.frame-blocks-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.frame-blocks-table th,
.frame-blocks-table td { padding: .6rem .8rem; border-bottom: 1px solid var(--frame-border); text-align: right; font-size: .88rem; }
.frame-blocks-table th { background: var(--frame-bg); font-weight: 600; color: var(--frame-muted); }
.frame-badge-system { background: #e8f0fe; color: var(--frame-primary); padding: 2px 8px; border-radius: 20px; font-size: .78rem; }
.frame-badge-always { background: #fee2e2; color: #b91c1c; padding: 2px 8px; border-radius: 20px; font-size: .78rem; }
.frame-search-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.frame-search-row input { flex: 1; min-width: 150px; padding: .5rem .7rem; border: 1px solid var(--frame-border); border-radius: 6px; font-family: var(--frame-font); }
.frame-add-btn { background: var(--frame-primary); color: #fff; border: none; border-radius: 6px; padding: .5rem 1rem; cursor: pointer; font-family: var(--frame-font); white-space: nowrap; }
.frame-delete-btn { background: none; border: none; cursor: pointer; color: #ef4444; padding: 4px; }
