:root {
  --bg-main: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --primary: #1a73e8;
  --primary-hover: #1557b0;
  --primary-soft: rgba(26, 115, 232, 0.1);
  --text-main: #202124;
  --text-sub: #5f6368;
  --border: #dadce0;
  --success: #16833a;
  --danger: #c5221f;
  --warning: #b06000;
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at top right, rgba(26, 115, 232, 0.12), transparent 31%),
    linear-gradient(135deg, #f8fafc 0%, #eef3f9 100%);
  color: var(--text-main);
  margin: 0;
  padding: 28px 16px;
  min-height: 100vh;
}

body[dir="ltr"] {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.page-shell {
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
}

.top-hero {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(218, 220, 224, 0.75);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  margin-bottom: 18px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-title {
  margin: 0;
  font-size: clamp(21px, 2.5vw, 28px);
  color: var(--primary);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-subtitle {
  margin: 6px 0 0;
  color: var(--text-sub);
  font-size: 14px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hero-badge,
.lang-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(26, 115, 232, 0.16);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
}

.lang-link { background: #fff; color: var(--text-main); }
.lang-link:hover { border-color: var(--primary); color: var(--primary); }

.layout-with-ads {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 130px;
  gap: 16px;
  align-items: start;
}

.ad-rail {
  min-height: 560px;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
  padding: 12px;
  position: sticky;
  top: 18px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  gap: 28px;
  background: var(--surface);
  padding: 30px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  border: 1px solid rgba(218, 220, 224, 0.85);
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.section-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: #fff;
}

.section-title {
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.subtitle {
  font-size: 13px;
  color: var(--text-sub);
  margin: 0;
  line-height: 1.8;
}

.tabs-container {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-sub);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 10px;
  transition: var(--transition);
  white-space: nowrap;
}

.tab-btn:hover,
.tab-btn.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.dynamic-input-section {
  background: var(--surface-soft);
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(218, 220, 224, 0.8);
  margin-top: 14px;
}

.input-block { display: none; }
.input-block.active { display: block; animation: fadeIn 0.22s ease; }

label {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
}

.hint {
  color: var(--text-sub);
  font-size: 12px;
  line-height: 1.7;
  margin-top: 6px;
}

.input-field,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  font-family: inherit;
  margin-top: 7px;
  background: var(--surface);
  color: var(--text-main);
  transition: var(--transition);
}

textarea {
  min-height: 105px;
  resize: vertical;
  line-height: 1.8;
}

.input-field:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.input-grid-mini,
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
}

.option-box {
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fff;
  min-width: 0;
}

.option-box label {
  font-size: 12px;
  color: var(--text-sub);
}

.option-box select,
.option-box input[type="color"],
.option-box input[type="range"] {
  width: 100%;
  margin-top: 0;
}

.option-box input[type="color"] {
  height: 42px;
  cursor: pointer;
  padding: 3px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #fff;
}

.template-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 9px 13px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  font-size: 12px;
  color: var(--text-main);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 7px;
}

.template-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(26, 115, 232, 0.04);
}

.color-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.file-upload-btn {
  border: 2px dashed var(--border);
  padding: 14px;
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-sub);
  font-weight: 800;
  background: #fff;
}

.file-upload-btn:hover {
  border-color: var(--primary);
  background: rgba(26, 115, 232, 0.04);
  color: var(--primary);
}

.preview-panel {
  background: var(--bg-main);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--border);
  align-self: start;
  overflow: hidden;
  position: sticky;
  top: 18px;
}

.qr-frame-title {
  width: 100%;
  text-align: center;
  margin-bottom: 12px;
}

.qr-frame-title h2 {
  margin: 0;
  color: var(--primary);
  font-size: 18px;
  font-weight: 800;
}

.qr-frame-title p {
  margin: 4px 0 0;
  color: var(--text-sub);
  font-size: 12px;
  line-height: 1.7;
}

#canvas-container {
  background: #fff;
  padding: 16px;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.1);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 315px;
  min-height: 315px;
}

#qr-canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

.qr-status {
  width: 100%;
  border: 1px solid rgba(22, 131, 58, 0.24);
  background: rgba(22, 131, 58, 0.06);
  color: var(--success);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 14px;
  line-height: 1.7;
}

.download-group {
  width: 100%;
  max-width: 365px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-inline: auto;
}

.btn {
  width: 100%;
  min-height: 54px;
  padding: 13px 16px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  font-family: inherit;
  text-align: center;
  line-height: 1.6;
  white-space: normal;
  overflow: hidden;
}

.btn .material-icons-round { font-size: 22px; line-height: 1; flex: 0 0 auto; }
.btn .btn-label { display: inline-block; min-width: 0; max-width: 100%; overflow-wrap: break-word; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-outline { background: #fff; color: var(--text-main); border: 1px solid var(--border); }
.btn-outline:hover { background: rgba(0, 0, 0, 0.035); border-color: #9aa0a6; }
.btn-danger { background: rgba(197, 34, 31, 0.07); color: var(--danger); border: 1px solid rgba(197, 34, 31, 0.22); }
.btn-danger:hover { background: rgba(197, 34, 31, 0.12); }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 12px;
}

.switch-row strong { font-size: 13px; }
.switch-row span { display: block; color: var(--text-sub); font-size: 11px; line-height: 1.6; margin-top: 3px; }
.switch { position: relative; width: 48px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background-color: #c8ced6; transition: var(--transition); border-radius: 999px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; inset-block-end: 3px; inset-inline-start: 3px; background-color: #fff; transition: var(--transition); border-radius: 50%; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25); }
.switch input:checked + .slider { background-color: var(--primary); }
.switch input:checked + .slider:before { inset-inline-start: 25px; }

.privacy-box {
  width: 100%;
  margin-top: 16px;
  background: rgba(26, 115, 232, 0.07);
  border: 1px solid rgba(26, 115, 232, 0.16);
  color: #174ea6;
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 12px;
  line-height: 1.8;
  text-align: center;
}

.credit {
  margin-top: 18px;
  color: var(--text-sub);
  font-size: 12px;
  text-align: center;
  line-height: 1.8;
}
.credit strong { color: var(--primary); }

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #202124;
  color: #fff;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  z-index: 9999;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1200px) {
  .layout-with-ads { grid-template-columns: 1fr; }
  .ad-rail { display: none; }
}

@media (max-width: 980px) {
  body { padding: 14px 10px; }
  .top-hero { flex-direction: column; align-items: flex-start; padding: 18px; }
  .hero-actions { justify-content: flex-start; }
  .workspace { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
  .preview-panel { position: relative; top: auto; order: -1; padding: 18px; }
}

@media (max-width: 620px) {
  .brand-title { font-size: 20px; }
  .input-grid-mini, .options-grid { grid-template-columns: 1fr; }
  .tab-btn { padding: 9px 12px; font-size: 13px; }
  #canvas-container { max-width: 290px; min-height: 290px; padding: 12px; }
  .section-card { padding: 14px; }
  .download-group { max-width: 100%; }
}


/* Content / SEO pages */
.site-footer {
  margin-top: 18px;
  background: rgba(255,255,255,0.86);
  border: 1px solid rgba(218,220,224,0.8);
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: 0 8px 18px rgba(15,23,42,0.05);
  text-align: center;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}
.footer-links a,
.inline-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 800;
}
.footer-links a {
  border: 1px solid rgba(26,115,232,0.16);
  background: rgba(26,115,232,0.06);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
}
.footer-links a:hover,
.inline-link:hover { text-decoration: underline; }
.footer-note { color: var(--text-sub); font-size: 12px; line-height: 1.8; margin: 0; }
.content-shell {
  background: var(--surface);
  border: 1px solid rgba(218,220,224,0.85);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 28px;
}
.content-hero {
  background: linear-gradient(135deg, rgba(26,115,232,0.10), rgba(255,255,255,0.92));
  border: 1px solid rgba(26,115,232,0.16);
  border-radius: var(--radius-xl);
  padding: 26px;
  margin-bottom: 18px;
}
.content-hero h1 {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 800;
  line-height: 1.35;
}
.content-hero p { margin: 0; color: var(--text-sub); line-height: 1.9; font-size: 15px; }
.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.content-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: #fff;
}
.content-card h2,
.content-card h3 {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.content-card p,
.content-card li {
  color: var(--text-main);
  line-height: 1.9;
  font-size: 14px;
}
.content-card p { margin: 0 0 10px; }
.content-card ul,
.content-card ol { margin: 0; padding-inline-start: 22px; }
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.cta-row .btn { width: auto; min-height: 46px; padding-inline: 18px; text-decoration: none; }
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
  margin-top: 16px;
}
.kpi-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  font-weight: 800;
  color: var(--primary);
}
.kpi-box span { display:block; color: var(--text-sub); font-size: 12px; font-weight: 700; margin-top: 4px; }
.ltr-block { direction: ltr; text-align: left; }
.notice-box {
  border: 1px solid rgba(26,115,232,0.20);
  background: rgba(26,115,232,0.07);
  color: #174ea6;
  border-radius: var(--radius-lg);
  padding: 14px;
  line-height: 1.9;
  font-size: 14px;
}
@media (max-width: 760px) {
  .content-shell { padding: 16px; }
  .content-grid, .kpi-grid { grid-template-columns: 1fr; }
  .content-hero { padding: 20px; }
  .cta-row .btn { width: 100%; }
}
