/**
 * احتياطي يُحمَّل من /cx-app-fallback.css مباشرة (لا يمرّ عبر Webpack chunks).
 * يُستخدم عند فشل تحميل CSS المُجمَّع (كاش، مسار يونيكود، ChunkLoadError).
 * يُحمَّل أولاً؛ عند نجاح Tailwind تُكمّل الأنماط فوقه.
 */

:root {
  --background: #fafaf8;
  --foreground: #1c1917;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: system-ui, "Segoe UI", Tahoma, sans-serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

.cx-bg-app {
  background-color: #fafaf8;
  background-image:
    linear-gradient(
      165deg,
      rgba(250, 250, 248, 0.94) 0%,
      rgba(255, 247, 237, 0.9) 42%,
      rgba(236, 253, 245, 0.93) 100%
    ),
    url("/cx-social-bg.svg");
  background-repeat: no-repeat, no-repeat;
  background-size: auto, cover;
  background-position: center, center;
}

.cx-title {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.cx-card {
  border-radius: 1rem;
  border: 2px solid #d6d3d1;
  background: #fff;
  box-shadow:
    0 4px 6px -1px rgb(0 0 0 / 0.07),
    0 2px 4px -2px rgb(0 0 0 / 0.06);
}

.cx-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  color: #fff;
  border: none;
  cursor: pointer;
  background: linear-gradient(180deg, #ea580c 0%, #c2410c 100%);
  box-shadow:
    0 4px 14px rgba(234, 88, 12, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-decoration: none;
  box-sizing: border-box;
}

.cx-btn-primary:hover {
  filter: brightness(1.05);
}

.cx-btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* منطقة المستخدم */
.cx-user-shell-body {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  min-height: 100vh;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .cx-user-shell-body {
    display: grid;
    grid-template-columns: 17.5rem minmax(0, 1fr);
    align-items: start;
    column-gap: 0;
  }
}

.cx-user-shell-sidebar {
  display: none;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .cx-user-shell-sidebar {
    display: flex;
    flex-direction: column;
    width: 17.5rem;
    flex-shrink: 0;
    border-left: 2px solid #d6d3d1;
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem 0 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  }
}

.cx-user-shell-mobile-top {
  display: block;
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid #e7e5e4;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.75rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

@media (min-width: 768px) {
  .cx-user-shell-mobile-top {
    display: none;
  }
}

.cx-user-shell-mobile-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.125rem;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  border-top: 2px solid #d6d3d1;
  background: #fff;
  padding: 0.25rem 0.125rem;
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.08);
}

@media (min-width: 768px) {
  .cx-user-shell-mobile-bottom {
    display: none;
  }
}

.cx-user-shell-main {
  box-sizing: border-box;
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  padding-top: max(6.5rem, calc(env(safe-area-inset-top, 0px) + 5.75rem));
  padding-bottom: 5rem;
  padding-inline: 0.75rem;
}

@media (min-width: 768px) {
  .cx-user-shell-main {
    padding-top: 2rem;
    padding-bottom: 2.5rem;
    padding-inline: 1.5rem;
    min-width: 0;
  }
}

.cx-user-shell {
  overflow-x: hidden;
  max-width: 100%;
}

.cx-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

.cx-sidebar-nav a {
  text-decoration: none;
  box-sizing: border-box;
  max-width: 100%;
}

/* تسجيل / تسجيل دخول */
.cx-auth-page {
  min-height: 100vh;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem 3rem;
}

.cx-auth-header {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto 2rem;
  text-align: center;
  box-sizing: border-box;
}

.cx-auth-header--wide {
  max-width: 32rem;
}

.cx-auth-card {
  width: 100%;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  padding: 1.5rem 1.25rem;
  border-radius: 1rem;
  border: 2px solid #d6d3d1;
  background: #ffffff;
  box-shadow:
    0 4px 6px -1px rgb(0 0 0 / 0.07),
    0 2px 4px -2px rgb(0 0 0 / 0.06);
}

.cx-auth-card--wide {
  max-width: 32rem;
  padding: 1.75rem 1.5rem;
}

.cx-auth-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.cx-auth-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  width: 100%;
  box-sizing: border-box;
}

.cx-auth-field > label {
  display: block;
  width: 100%;
  font-size: 0.875rem;
  font-weight: 700;
  color: #44403c;
  text-align: right;
}

.cx-auth-field input:not([type="radio"]):not([type="checkbox"]) {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.75rem;
  border: 2px solid #d6d3d1;
  border-radius: 0.75rem;
  background: #fff;
  font-size: 1rem;
  color: #1c1917;
}

.cx-auth-submit {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.25rem;
  padding: 0.85rem 1.25rem;
  border: none;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, #ea580c 0%, #c2410c 100%);
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
  text-align: center;
}

.cx-auth-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.cx-auth-secondary-link {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  text-align: center;
  text-decoration: none;
  border-radius: 0.75rem;
  border: 2px solid #fdba74;
  background: #fff7ed;
  color: #7c2d12;
  font-size: 0.875rem;
  font-weight: 800;
}

.cx-auth-footer-note {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 2px solid #e7e5e4;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: #57534e;
  line-height: 1.65;
}

.cx-auth-footer-note a {
  color: #c2410c;
  font-weight: 800;
}

.text-cx-terra {
  color: #ea580c;
}

.text-cx-terra-dark {
  color: #c2410c;
}

/* شائعة في صفحات login/register عند تعطّل Tailwind */
.text-stone-500 {
  color: #78716c;
}
.text-stone-600 {
  color: #57534e;
}
.text-stone-700 {
  color: #44403c;
}
.text-stone-800 {
  color: #292524;
}
.text-stone-900 {
  color: #1c1917;
}
.text-stone-950 {
  color: #0c0a09;
}
.text-xs {
  font-size: 0.75rem;
  line-height: 1rem;
}
.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.text-2xl {
  font-size: 1.5rem;
  line-height: 2rem;
}
.text-3xl {
  font-size: 1.875rem;
  line-height: 2.25rem;
}
.text-center {
  text-align: center;
}
.font-semibold {
  font-weight: 600;
}
.font-medium {
  font-weight: 500;
}
.font-bold {
  font-weight: 700;
}
.font-extrabold {
  font-weight: 800;
}
.mb-2 {
  margin-bottom: 0.5rem;
}
.mb-5 {
  margin-bottom: 1.25rem;
}
.mb-8 {
  margin-bottom: 2rem;
}
.leading-relaxed {
  line-height: 1.625;
}
.rounded-lg {
  border-radius: 0.5rem;
}
.border-red-200 {
  border-color: #fecaca;
}
.bg-red-50 {
  background-color: #fef2f2;
}
.text-red-800 {
  color: #991b1b;
}
.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.border {
  border-width: 1px;
  border-style: solid;
}
