/* The license screens (license-ui.js): the Garment ERP's activation card and license page, "Lotus Violet" theme.
   A program may set --lc-brand / --lc-brand-2 on .lc-root to use its own colors, and .lc-dark for dark mode. */

.lc-root {
  --lc-brand: #7c3aed;
  --lc-brand-2: #db2777;
  --lc-brand-soft: #f3e8ff;
  --lc-bg: linear-gradient(135deg, #f3e8ff 0%, #fdf2f8 50%, #eef2ff 100%);
  --lc-surface: #ffffff;
  --lc-border: #ececf1;
  --lc-text: #1f1f2e;
  --lc-muted: #8c8c9a;
  --lc-radius: 8px;
  font-family: 'Cairo', 'Segoe UI', Tahoma, system-ui, sans-serif;
  color: var(--lc-text);
  font-size: 14px;
  line-height: 1.6;
  box-sizing: border-box;
}

.lc-root *,
.lc-root *::before,
.lc-root *::after {
  box-sizing: border-box;
}

.lc-root.lc-dark,
.lc-dark .lc-root {
  --lc-brand: #9b6cf6;
  --lc-brand-2: #ec4899;
  --lc-brand-soft: #2a1f47;
  --lc-bg: linear-gradient(135deg, #1e1535 0%, #2a1030 50%, #111a33 100%);
  --lc-surface: #1a1726;
  --lc-border: #2e2942;
  --lc-text: #ece9f7;
  --lc-muted: #9a94b3;
}

/* ---------- Full-window activation ---------- */

.lc-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  overflow: auto;
}

.lc-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--lc-bg);
}

.lc-card {
  background: var(--lc-surface);
  border: 1px solid var(--lc-border);
  border-radius: calc(var(--lc-radius) + 4px);
}

.lc-license-card {
  position: relative;
  width: 100%;
  max-width: 640px;
  padding: 24px 28px 28px;
  box-shadow: 0 20px 50px color-mix(in srgb, var(--lc-brand) 14%, transparent);
}

.lc-card-tools {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
}

.lc-brand {
  width: 64px;
  height: 64px;
  margin: 8px auto 16px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 32px;
  color: #fff;
  background: linear-gradient(135deg, var(--lc-brand), var(--lc-brand-2));
  overflow: hidden;
}

.lc-brand img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lc-title {
  margin: 0 0 4px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--lc-text);
}

.lc-center {
  text-align: center;
}

.lc-muted {
  color: var(--lc-muted);
}

.lc-small {
  font-size: 13px;
}

.lc-label {
  display: block;
  margin-top: 4px;
  font-weight: 700;
}

.lc-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--lc-border);
  text-align: center;
  color: var(--lc-muted);
  font-size: 13px;
}

.lc-body > * + * {
  margin-top: 6px;
}

/* ---------- Alerts, buttons, inputs ---------- */

.lc-alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 14px;
  margin: 12px 0 16px;
  border-radius: var(--lc-radius);
  border: 1px solid;
}

.lc-alert[hidden] {
  display: none;
}

.lc-alert-icon {
  font-size: 16px;
  line-height: 1.5;
}

.lc-alert-warning {
  background: #fffbe6;
  border-color: #ffe58f;
  color: #1f1f2e;
}

.lc-alert-warning .lc-alert-icon {
  color: #faad14;
}

.lc-alert-error {
  background: #fff2f0;
  border-color: #ffccc7;
  color: #a8071a;
  margin: 8px 0;
}

.lc-dark .lc-alert-warning,
.lc-dark.lc-root .lc-alert-warning {
  background: #2b2111;
  border-color: #594214;
  color: var(--lc-text);
}

.lc-alert-info {
  background: #e6f4ff;
  border-color: #91caff;
  color: #10239e;
  margin: 8px 0;
}

.lc-dark .lc-alert-info,
.lc-dark.lc-root .lc-alert-info {
  background: #111a2c;
  border-color: #15325b;
  color: #91caff;
}

/* كلمة سر التفعيل (من غير نت) */
.lc-password {
  display: block;
  margin-top: 10px;
}

.lc-password[hidden] {
  display: none;
}

.lc-password input {
  width: 100%;
  height: 36px;
  box-sizing: border-box;
}

.lc-dark .lc-alert-error,
.lc-dark.lc-root .lc-alert-error {
  background: #2a1215;
  border-color: #58181c;
  color: #ffa39e;
}

.lc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 15px;
  border-radius: var(--lc-radius);
  border: 1px solid var(--lc-border);
  background: var(--lc-surface);
  color: var(--lc-text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s, opacity 0.2s;
}

.lc-btn:hover:not(:disabled) {
  border-color: var(--lc-brand);
  color: var(--lc-brand);
}

.lc-btn-primary {
  background: var(--lc-brand);
  border-color: var(--lc-brand);
  color: var(--lc-on-brand, #fff);
  box-shadow: 0 2px 0 color-mix(in srgb, var(--lc-brand) 20%, transparent);
}

.lc-btn-primary:hover:not(:disabled) {
  opacity: 0.88;
  color: var(--lc-on-brand, #fff);
}

.lc-btn-danger {
  color: #dc2626;
  border-color: #fca5a5;
}

.lc-btn-small {
  height: 26px;
  padding: 0 8px;
  font-size: 13px;
}

.lc-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lc-loading::after {
  content: '';
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation: lc-spin 0.7s linear infinite;
}

@keyframes lc-spin {
  to {
    transform: rotate(360deg);
  }
}

.lc-key-input {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--lc-border);
  border-radius: var(--lc-radius);
  background: var(--lc-surface);
  color: var(--lc-text);
  font-family: Consolas, 'Courier New', monospace;
  font-size: 14px;
  direction: ltr;
  resize: vertical;
  outline: none;
}

.lc-key-input:focus {
  border-color: var(--lc-brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--lc-brand) 18%, transparent);
}

.lc-activate {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
}

.lc-activate .lc-alert {
  align-self: stretch;
  margin: 0;
}

.lc-machine-code {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 22px;
  letter-spacing: 2px;
  direction: ltr;
  unicode-bidi: isolate;
}

.lc-small-code {
  font-size: 13px;
  letter-spacing: 1px;
}

.lc-code-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 6px 0 4px;
}

.lc-seg {
  display: inline-flex;
  padding: 2px;
  border-radius: var(--lc-radius);
  background: color-mix(in srgb, var(--lc-text) 6%, transparent);
}

.lc-seg button {
  border: 0;
  background: none;
  font: inherit;
  font-size: 12px;
  padding: 1px 10px;
  border-radius: 6px;
  color: var(--lc-muted);
  cursor: pointer;
}

.lc-seg button.on {
  background: var(--lc-surface);
  color: var(--lc-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.lc-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2147483600;
  padding: 8px 16px;
  border-radius: 8px;
  background: #16a34a;
  color: #fff;
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* ---------- License page ---------- */

.lc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 800px) {
  .lc-grid {
    grid-template-columns: 1fr;
  }
}

.lc-wide {
  grid-column: 1 / -1;
}

.lc-card-small {
  display: flex;
  flex-direction: column;
}

.lc-card-head {
  padding: 10px 16px;
  font-weight: 700;
  border-bottom: 1px solid var(--lc-border);
}

.lc-card-body {
  padding: 12px 16px;
  flex: 1;
}

.lc-desc-row {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  align-items: center;
  flex-wrap: wrap;
}

.lc-desc-row > span {
  color: var(--lc-muted);
  min-width: 120px;
}

.lc-desc-row > span::after {
  content: ':';
}

.lc-tag {
  display: inline-block;
  padding: 0 7px;
  font-size: 12px;
  line-height: 20px;
  border-radius: 4px;
  border: 1px solid;
  white-space: nowrap;
}

.lc-tag-green { color: #389e0d; background: #f6ffed; border-color: #b7eb8f; }
.lc-tag-blue { color: #0958d9; background: #e6f4ff; border-color: #91caff; }
.lc-tag-red { color: #cf1322; background: #fff1f0; border-color: #ffa39e; }
.lc-tag-gold { color: #d48806; background: #fffbe6; border-color: #ffe58f; }
.lc-tag-purple { color: #531dab; background: #f9f0ff; border-color: #d3adf7; }
.lc-tag-default { color: var(--lc-muted); background: transparent; border-color: var(--lc-border); }

.lc-table-wrap {
  overflow-x: auto;
}

.lc-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.lc-table th,
.lc-table td {
  padding: 8px;
  text-align: start;
  border-bottom: 1px solid var(--lc-border);
}

.lc-table th {
  font-weight: 600;
  background: color-mix(in srgb, var(--lc-text) 3%, transparent);
}

/* ---------- Banner ---------- */

.lc-banner {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 16px;
  background: #fffbe6;
  border-bottom: 1px solid #ffe58f;
  color: #1f1f2e;
}

.lc-banner .lc-alert-icon {
  color: #faad14;
}

.lc-banner-error {
  background: #fff2f0;
  border-color: #ffccc7;
}

.lc-banner-error .lc-alert-icon {
  color: #ff4d4f;
}

/* ---------- شرح البرنامج / حول البرنامج جوه شاشة التفعيل (مفتوحين والبرنامج مقفول) ---------- */
.lc-meta-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--lc-border);
}
.lc-btn-ghost {
  background: transparent;
}
.lc-meta-card {
  max-width: 820px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.lc-meta-card .lc-card-tools {
  position: static;
  display: flex;
  justify-content: flex-end;
}
.lc-meta-body {
  line-height: 1.9;
  text-align: start;
}
.lc-meta-logo {
  width: 84px;
  height: 84px;
  object-fit: contain;
}
.lc-meta-member {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--lc-border);
  border-radius: var(--lc-radius);
}
.lc-meta-phone {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.lc-meta-phone .lc-btn {
  height: 28px;
  padding: 0 10px;
}

/* تذكير انتهاء الترخيص (آخر 7 أيام) — بيتقفل لحد بكرة */
.lc-reminder {
  position: fixed;
  bottom: 18px;
  inset-inline-start: 18px;
  z-index: 99998;
  max-width: 360px;
  background: var(--lc-surface);
  color: var(--lc-text);
  border: 1px solid var(--lc-border);
  border-top: 4px solid #d97706;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  padding: 14px 16px 12px;
  font-size: 13px;
}
.lc-reminder-urgent { border-top-color: #dc2626; }
.lc-reminder-title { display: flex; gap: 8px; align-items: flex-start; font-weight: 700; line-height: 1.6; margin-bottom: 8px; padding-inline-end: 22px; }
.lc-reminder-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 6px; }
.lc-reminder-x { position: absolute; top: 8px; inset-inline-end: 8px; border: 0; background: transparent; color: var(--lc-muted); cursor: pointer; font-size: 14px; }

/* QR كود الجهاز (تطبيق الموبايل بيقراه): أبيض وأسود دايمًا، ومن الشمال لليمين حتى في العربي */
.lc-qr { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.lc-qr-img { display: inline-block; direction: ltr; background: #fff; padding: 4px; border-radius: 8px; line-height: 0; }
.lc-qr-img svg { width: 116px; height: 116px; }

/* «إرسال طلب تفعيل» */
.lc-request { margin: 4px 0 14px; }
.lc-req-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
@media (max-width: 520px) { .lc-req-grid { grid-template-columns: minmax(0, 1fr); } }
.lc-request .lc-input, .lc-req-grid .lc-input {
  width: 100%; height: 38px; box-sizing: border-box; padding: 6px 10px; border-radius: var(--lc-radius, 8px);
  border: 1px solid var(--lc-border, #d9d9e3); background: var(--lc-surface, #fff); color: inherit; font: inherit;
}
.lc-request .lc-btn-small { margin-top: 8px; }
