/* qr.erticaz.com — shared styles, matching erticaz.com visual identity
   (Cairo + Tajawal fonts, violet/purple brand on light theme). */
:root {
  /* Brand palette pulled from erticaz.com */
  --brand: #5d4d9e;        /* primary violet */
  --brand-deep: #2a1f5e;   /* deep indigo */
  --brand-light: #b8a8ff;  /* light violet */
  --accent: #ff6b6b;       /* coral CTA */
  --accent-2: #ff8a8a;
  --lav-1: #f5f2ff;        /* lightest lavender bg */
  --lav-2: #f3f0ff;
  --lav-3: #e8e3ff;
  --lav-line: #d4cfee;

  --bg: #f5f2ff;
  --surface: #ffffff;
  --text: #2a1f5e;
  --muted: #7b71a8;
  --good: #1f9d6b;
  --warn: #d98a00;
  --bad: #c92a2a;
  --radius: 16px;
  --shadow: 0 12px 34px rgba(42,31,94,.12);
  --shadow-sm: 0 4px 14px rgba(42,31,94,.08);
  --shadow-lg: 0 22px 48px rgba(42,31,94,.18);
  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur: 260ms;
  --font: "Cairo", "Tajawal", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(900px 500px at 90% -8%, var(--lav-3) 0%, var(--bg) 55%) fixed,
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.7;
  min-height: 100vh;
}
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }

/* Header — dark brand bar with the white logo */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 28px; border-bottom: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(120deg, var(--brand-deep) 0%, var(--brand) 130%);
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; min-width: 0; }
.brand .logo-img { height: 38px; width: auto; max-width: 190px; object-fit: contain; display: block; }
.brand .sep { width: 1px; height: 24px; background: rgba(255,255,255,.25); flex: none; }
.brand .pill {
  font-size: 13px; font-weight: 700; color: #fff; white-space: nowrap;
  background: rgba(255,255,255,.16); padding: 5px 12px; border-radius: 999px;
}
.topnav { display: flex; align-items: center; gap: 8px; flex: none; }
.topnav a, .btn-ghost {
  color: rgba(255,255,255,.9); padding: 8px 14px; border-radius: 10px; font-weight: 700;
  border: 1px solid transparent; background: transparent;
}
.topnav a:hover, .btn-ghost:hover { background: rgba(255,255,255,.14); color: #fff; }
.lang-toggle {
  border: 1px solid rgba(255,255,255,.3); border-radius: 10px; padding: 8px 14px;
  color: #fff; background: rgba(255,255,255,.1); font-weight: 700;
}
.lang-toggle:hover { background: rgba(255,255,255,.2); }

/* Layout */
.wrap { max-width: 1180px; margin: 0 auto; padding: 28px; }
.hero { text-align: center; padding: 46px 16px 6px; }
.hero h1 {
  font-size: clamp(28px, 4.4vw, 44px); margin: 0 0 14px; font-weight: 900;
  background: linear-gradient(120deg, var(--brand-deep), var(--brand));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { color: var(--muted); max-width: 660px; margin: 0 auto; font-size: 17px; }

.card {
  background: var(--surface);
  border: 1px solid var(--lav-line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px;
}
.grid-gen { display: grid; grid-template-columns: 1.15fr .85fr; gap: 22px; margin-top: 24px; }
@media (max-width: 900px) { .grid-gen { grid-template-columns: 1fr; } }

/* Type tabs */
.type-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.type-tabs button {
  border: 1px solid var(--lav-line); background: var(--lav-1); color: var(--brand-deep);
  padding: 9px 14px; border-radius: 999px; font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; gap: 7px; transition: .15s;
}
.type-tabs button.active { background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff; border-color: transparent; }
.type-tabs button:hover { border-color: var(--brand); }

/* Forms */
label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; font-weight: 700; }
input, select, textarea {
  width: 100%; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--lav-line);
  background: #fff; color: var(--text); font-size: 15px; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(93,77,158,.12); }
textarea { min-height: 90px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }

/* Styling panel */
.style-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type=color] { width: 46px; height: 40px; padding: 2px; border-radius: 9px; border: 1px solid var(--lav-line); }
details.styler { margin-top: 16px; border: 1px solid var(--lav-line); border-radius: 12px; padding: 6px 16px; background: var(--lav-1); }
details.styler summary { cursor: pointer; font-weight: 800; padding: 10px 0; color: var(--brand-deep); }

/* Preview */
.preview { position: sticky; top: 92px; text-align: center; }
.qr-stage {
  background: #fff; border: 1px solid var(--lav-line); border-radius: 18px; padding: 18px; display: inline-block;
  box-shadow: var(--shadow); min-width: 240px; min-height: 240px;
}
.qr-frame-text { margin-top: 10px; font-weight: 900; letter-spacing: 1px; color: var(--brand-deep); }
.btn {
  border: none; border-radius: 12px; padding: 12px 18px; font-weight: 800; font-size: 15px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn:hover { filter: brightness(1.07); }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.btn-row .btn { flex: 1; min-width: 120px; }
.btn-sec { background: #fff; color: var(--brand-deep); border: 1px solid var(--lav-line); box-shadow: none; }
.btn-sec:hover { border-color: var(--brand); filter: none; background: var(--lav-1); }

.footer { text-align: center; color: var(--muted); padding: 34px; font-size: 14px; }
.footer a { font-weight: 700; }

/* SEO content */
.seo { padding-top: 24px; }
.seo h2 { font-size: 24px; color: var(--brand-deep); margin: 34px 0 12px; }
.seo > div > p { color: #4c4374; font-size: 16px; max-width: 860px; }
.seo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 18px 0 8px; }
@media (max-width: 820px) { .seo-grid { grid-template-columns: 1fr; } }
.seo-card { background: var(--surface); border: 1px solid var(--lav-line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow-sm); }
.seo-card h3 { margin: 0 0 6px; font-size: 17px; color: var(--brand-deep); }
.seo-card p { margin: 0; color: var(--muted); font-size: 14px; }
.seo-steps { max-width: 760px; color: #4c4374; font-size: 16px; }
.seo-steps li { margin-bottom: 8px; }
.faq { background: var(--surface); border: 1px solid var(--lav-line); border-radius: 12px; padding: 4px 18px; margin-bottom: 10px; max-width: 860px; }
.faq summary { cursor: pointer; font-weight: 800; padding: 12px 0; color: var(--brand-deep); }
.faq p { margin: 0 0 14px; color: var(--muted); }
.lang-hidden { display: none !important; }

/* ---------- Modern polish: micro-interactions, motion, a11y ---------- */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: translateY(0); } }
.hero { animation: fadeInUp .6s var(--ease) both; }
.grid-gen { animation: fadeInUp .6s var(--ease) .08s both; }

/* Hover-lift on interactive surfaces */
.card, .stat, .chart-card, .seo-card, .btn { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), filter var(--dur) var(--ease); }
.seo-card:hover, .stat:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.type-tabs button, .iconbtn { transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.type-tabs button:hover { transform: translateY(-1px); }

/* Soft brand glow behind the QR preview */
.preview .qr-stage { position: relative; }
.preview .qr-stage::before {
  content: ""; position: absolute; inset: -24px; z-index: -1; border-radius: 30px;
  background: radial-gradient(closest-side, rgba(93,77,158,.28), transparent 75%);
  filter: blur(8px);
}

/* Accessible focus rings */
a:focus-visible, button:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 8px;
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- Admin ---------- */
.login-wrap { max-width: 390px; margin: 7vh auto; }
.login-wrap .card { padding: 32px; }
.login-wrap h2 { margin: 0 0 18px; text-align: center; color: var(--brand-deep); }

.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 70px); }
@media (max-width: 800px) { .admin-shell { grid-template-columns: 1fr; } }
.side {
  border-inline-end: 1px solid var(--lav-line); padding: 18px 12px; background: rgba(255,255,255,.6);
}
.side a {
  display: block; padding: 11px 14px; border-radius: 11px; color: var(--muted);
  font-weight: 700; margin-bottom: 4px;
}
.side a.active, .side a:hover { background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff; }
.main { padding: 28px; }
.main h2 { margin-top: 0; color: var(--brand-deep); }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 22px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--lav-line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow-sm); }
.stat .n { font-size: 28px; font-weight: 900; color: var(--brand); }
.stat .l { color: var(--muted); font-size: 13px; font-weight: 700; }

.charts { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 22px; }
.charts-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 22px; }
@media (max-width: 900px) { .charts, .charts-3 { grid-template-columns: 1fr; } }
.chart-card { background: var(--surface); border: 1px solid var(--lav-line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow-sm); }
.chart-card h3 { margin: 0 0 12px; font-size: 15px; color: var(--brand-deep); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 10px; text-align: start; border-bottom: 1px solid var(--lav-line); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
td .mini { color: var(--muted); font-size: 12px; }
.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.badge.on { background: rgba(31,157,107,.13); color: var(--good); }
.badge.off { background: rgba(201,42,42,.12); color: var(--bad); }
.iconbtn { background: var(--lav-1); border: 1px solid var(--lav-line); color: var(--brand-deep); border-radius: 9px; padding: 5px 9px; font-size: 12px; font-weight: 700; margin-inline-end: 4px; }
.iconbtn:hover { background: var(--brand); color: #fff; border-color: transparent; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(42,31,94,.5); display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px; backdrop-filter: blur(3px); }
.modal-bg.open { display: flex; }
.modal { background: #fff; border: 1px solid var(--lav-line); border-radius: 18px; padding: 26px; max-width: 560px; width: 100%; max-height: 90vh; overflow: auto; box-shadow: var(--shadow); }
.modal h3 { margin-top: 0; color: var(--brand-deep); }
.close-x { float: inline-end; background: none; border: none; color: var(--muted); font-size: 24px; line-height: 1; }

.toast { position: fixed; inset-block-end: 24px; inset-inline-start: 50%; transform: translateX(-50%); background: var(--good); color: #fff; padding: 12px 22px; border-radius: 12px; font-weight: 800; z-index: 200; box-shadow: var(--shadow); display: none; }
.toast.show { display: block; }
.toast.err { background: var(--bad); }

.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tabs button { border: 1px solid var(--lav-line); background: var(--lav-1); color: var(--brand-deep); padding: 8px 16px; border-radius: 11px; font-weight: 700; }
.tabs button.active { background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff; border-color: transparent; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.copyfield { display: flex; gap: 8px; align-items: center; }
.copyfield input { background: #fff; }
