:root {
  --md-primary: #1a73e8;
  --md-primary-strong: #0b57d0;
  --md-primary-soft: #e8f0fe;
  --md-secondary: #00796b;
  --md-secondary-soft: #e0f2f1;
  --md-tertiary: #7c4dff;
  --md-danger: #c62828;
  --md-bg: #eef3fb;
  --md-surface: #ffffff;
  --md-surface-soft: #f7fafd;
  --md-border: #d2deef;
  --md-text: #12263a;
  --md-muted: #5a7088;
  --md-shadow: 0 22px 48px rgba(16, 45, 76, 0.1);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: 'Manrope', 'Cairo', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--md-text);
  background:
    radial-gradient(circle at 12% -10%, #d4e4ff 0%, rgba(212, 228, 255, 0) 46%),
    radial-gradient(circle at 92% 0%, #d6efe8 0%, rgba(214, 239, 232, 0) 42%),
    linear-gradient(180deg, #f4f8ff 0%, var(--md-bg) 100%);
}

body.is-ar,
body.is-ar input,
body.is-ar textarea,
body.is-ar select,
body.is-ar button {
  font-family: 'Cairo', 'Manrope', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

body.is-ar {
  direction: rtl;
}

a {
  color: inherit;
}

.front-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.front-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
  background: rgba(250, 252, 255, 0.9);
  border-bottom: 1px solid var(--md-border);
}

.front-header-inner {
  width: min(1260px, calc(100% - 2rem));
  margin: 0 auto;
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-inline-end: 0.8rem;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #0b57d0 0%, #1a73e8 55%, #00796b 100%);
  box-shadow: 0 10px 24px rgba(11, 87, 208, 0.38);
}

.brand-meta {
  display: grid;
  line-height: 1.1;
}

.brand-meta strong {
  font-size: 1rem;
}

.brand-meta span {
  color: var(--md-muted);
  font-size: 0.77rem;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-inline-end: auto;
}

.top-nav-link {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.42rem 0.9rem;
  text-decoration: none;
  color: #37526f;
  font-weight: 700;
  font-size: 0.83rem;
  transition: all 0.2s ease;
}

.top-nav-link:hover {
  color: var(--md-primary);
  background: var(--md-primary-soft);
  border-color: #c8d8f0;
}

.top-nav-link.active {
  color: #fff;
  border-color: #0f5fbd;
  background: linear-gradient(135deg, #1565c0 0%, #1a73e8 100%);
  box-shadow: 0 8px 20px rgba(26, 115, 232, 0.3);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-chip {
  border-radius: 999px;
  border: 1px solid var(--md-border);
  padding: 0.42rem 0.88rem;
  font-size: 0.8rem;
  font-weight: 750;
  background: #fff;
  color: #1f3650;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-chip:hover {
  border-color: #afc4de;
  transform: translateY(-1px);
}

.btn-chip.primary {
  border-color: #0f63c5;
  background: linear-gradient(135deg, #1565c0 0%, #1a73e8 100%);
  color: #fff;
}

.btn-chip.secondary {
  border-color: #009688;
  background: linear-gradient(135deg, #00796b 0%, #009688 100%);
  color: #fff;
}

.front-main {
  width: min(1260px, calc(100% - 2rem));
  margin: 1.3rem auto 2.2rem;
  display: grid;
  gap: 1rem;
}

.panel-card {
  background: var(--md-surface);
  border: 1px solid var(--md-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--md-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.panel-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 28px 48px rgba(16, 45, 76, 0.12);
}

.panel-card.pad {
  padding: 1.1rem;
}

.page-intro {
  position: relative;
  overflow: hidden;
}

.page-intro::after {
  content: '';
  position: absolute;
  right: -32px;
  top: -34px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(26, 115, 232, 0.18) 0%, rgba(26, 115, 232, 0) 70%);
}

.page-kicker {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #c5daf6;
  background: #ecf4ff;
  color: #1f5ea8;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.58rem;
}

.page-title {
  margin: 0.65rem 0 0.25rem;
  font-size: clamp(1.55rem, 2.2vw, 2.05rem);
  line-height: 1.15;
}

.page-subtitle {
  margin: 0;
  color: var(--md-muted);
}

.page-meta-chips {
  margin-top: 0.72rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.section-grid {
  display: grid;
  gap: 1rem;
}

.section-row {
  display: grid;
  gap: 1rem;
}

.section-row.columns-1 {
  grid-template-columns: minmax(0, 1fr);
}

.section-row.columns-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-row.columns-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-block {
  position: relative;
  overflow: hidden;
  padding: 1.35rem;
  border-radius: var(--radius-xl);
  background: linear-gradient(142deg, #0b57d0 0%, #1a73e8 48%, #00796b 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 24px 56px rgba(11, 87, 208, 0.35);
}

.hero-block::before,
.hero-block::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero-block::before {
  width: 260px;
  height: 260px;
  right: -68px;
  top: -105px;
  background: rgba(255, 255, 255, 0.14);
}

.hero-block::after {
  width: 210px;
  height: 210px;
  left: -72px;
  bottom: -108px;
  background: rgba(255, 255, 255, 0.11);
}

.hero-block > * {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
  padding: 0.22rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hero-title {
  margin: 0.72rem 0 0.42rem;
  font-size: clamp(1.6rem, 2.7vw, 2.3rem);
  line-height: 1.12;
}

.hero-subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  max-width: 760px;
}

.hero-highlights {
  margin-top: 0.72rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.hero-highlights span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.17);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 0.18rem 0.55rem;
  font-size: 0.73rem;
  font-weight: 700;
}

.hero-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.hero-btn {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  padding: 0.52rem 0.95rem;
  font-weight: 750;
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.12);
}

.hero-btn.is-solid {
  color: #0b57d0;
  background: #fff;
  border-color: #fff;
}

.section-card {
  background: var(--md-surface);
  border: 1px solid var(--md-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--md-shadow);
  overflow: hidden;
}

.section-card.compact {
  min-height: 100%;
}

.section-card .head {
  padding: 0.9rem 1rem 0.54rem;
  border-bottom: 1px solid #e6eef8;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.55rem;
}

.section-headline {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  min-width: 0;
}

.section-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.84rem;
  border: 1px solid #cae0f8;
  background: #eff6ff;
  color: #1f5ea8;
  flex-shrink: 0;
}

.section-icon-faq {
  border-color: #d9d1fa;
  background: #f2efff;
  color: #5c4ab3;
}

.section-icon-stats {
  border-color: #c7ebdf;
  background: #eaf9f3;
  color: #0d7a5f;
}

.section-icon-contact,
.section-icon-rich_text,
.section-icon-custom_html,
.section-icon-split {
  border-color: #f1e2be;
  background: #fff8e6;
  color: #a06700;
}

.section-card .head h3 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.2;
}

.section-card .head p {
  margin: 0.25rem 0 0;
  color: var(--md-muted);
  font-size: 0.86rem;
}

.section-kind {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.17rem 0.5rem;
  font-size: 0.69rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #486382;
  background: #eff4fb;
  border: 1px solid #d7e3f2;
}

.section-card .body {
  padding: 0.9rem 1rem 1rem;
}

.feature-grid {
  display: grid;
  gap: 0.72rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.feature-item {
  border: 1px solid var(--md-border);
  border-radius: var(--radius-md);
  padding: 0.82rem;
  background: linear-gradient(180deg, #fcfdff 0%, #f6faff 100%);
}

.feature-item h4 {
  margin: 0;
  font-size: 0.98rem;
}

.feature-item p {
  margin: 0.35rem 0 0;
  color: var(--md-muted);
  font-size: 0.9rem;
}

.split-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.stat-grid {
  display: grid;
  gap: 0.62rem;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}

.stat-box {
  border: 1px solid var(--md-border);
  background: linear-gradient(180deg, #fbfdff 0%, #f3f8ff 100%);
  border-radius: var(--radius-md);
  padding: 0.74rem;
}

.stat-box strong {
  display: block;
  font-size: 1.22rem;
  margin-top: 0.2rem;
}

.faq-item {
  border: 1px solid var(--md-border);
  border-radius: var(--radius-md);
  background: var(--md-surface-soft);
  padding: 0.62rem 0.78rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 750;
}

.faq-item p {
  margin: 0.55rem 0 0;
  color: var(--md-muted);
}

.auth-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.auth-card {
  position: relative;
  background: var(--md-surface);
  border: 1px solid var(--md-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--md-shadow);
  padding: 1rem;
}

.auth-card::before {
  content: '';
  position: absolute;
  inset-inline: 1rem;
  top: 0.62rem;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #1a73e8, #009688);
}

.auth-card h3 {
  margin: 0.24rem 0 0;
  font-size: 1.24rem;
}

.auth-card p {
  margin: 0.35rem 0 0.82rem;
  color: var(--md-muted);
}

.form-grid {
  display: grid;
  gap: 0.65rem;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 0.3rem;
}

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

.field label,
.field > span {
  font-size: 0.81rem;
  color: var(--md-muted);
  font-weight: 750;
}

.field label .req {
  color: var(--md-danger);
}

.field .hint {
  color: var(--md-muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid #c7d6ea;
  padding: 0.58rem 0.68rem;
  font: inherit;
  color: var(--md-text);
  background: #fff;
}

.field textarea {
  resize: vertical;
  min-height: 88px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: #76a9ea;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.16);
}

.field input[readonly],
.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  background: #f2f6fb;
  color: #60758e;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.button {
  border-radius: 10px;
  border: 1px solid #c4d6ea;
  background: #fff;
  color: var(--md-text);
  padding: 0.53rem 0.82rem;
  font-weight: 750;
  font-size: 0.84rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  transition: all 0.16s ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: #a7c3e1;
}

.button.primary {
  border-color: var(--md-primary);
  background: linear-gradient(135deg, #1565c0 0%, #1a73e8 100%);
  color: #fff;
}

.button.secondary {
  border-color: #0c8d7e;
  background: linear-gradient(135deg, #00796b 0%, #009688 100%);
  color: #fff;
}

.button.warn {
  border-color: #efb4b4;
  background: #fff0f0;
  color: #8f1f1f;
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.flash {
  border-radius: var(--radius-md);
  border: 1px solid #b8d4f3;
  background: #edf5ff;
  color: #184a7b;
  padding: 0.62rem 0.72rem;
  font-size: 0.84rem;
}

.flash.error {
  border-color: #edbcbc;
  background: #fff2f2;
  color: #8f2020;
}

.portal-shell {
  display: grid;
  gap: 1rem;
}

.portal-head {
  display: flex;
  justify-content: space-between;
  gap: 0.86rem;
  align-items: center;
  flex-wrap: wrap;
}

.portal-head h2 {
  margin: 0;
  font-size: 1.32rem;
}

.portal-head p {
  margin: 0.22rem 0 0;
  color: var(--md-muted);
}

.portal-controls {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
}

.portal-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  flex-wrap: wrap;
  padding: 0.33rem;
  border: 1px solid var(--md-border);
  border-radius: 999px;
  background: linear-gradient(180deg, #f7fbff 0%, #edf3fb 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.tab-btn {
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--md-muted);
  padding: 0.45rem 0.84rem;
  font-weight: 800;
  font-size: 0.79rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.tab-btn:hover {
  color: var(--md-primary);
  background: var(--md-primary-soft);
  border-color: #d0e0f2;
}

.tab-btn.active {
  color: #fff;
  border-color: #0f5fb8;
  background: linear-gradient(135deg, #1565c0, #1a73e8);
  box-shadow: 0 8px 18px rgba(21, 101, 192, 0.3);
}

.metrics-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.metric {
  border: 1px solid var(--md-border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fcfdff 0%, #f5f9ff 100%);
  padding: 0.72rem;
}

.metric strong {
  display: block;
  font-size: 1.14rem;
  margin-top: 0.28rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--md-border);
  border-radius: var(--radius-md);
}

.table-clean {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.table-clean th,
.table-clean td {
  border-bottom: 1px solid #e0e9f5;
  text-align: start;
  padding: 0.56rem 0.62rem;
  white-space: nowrap;
}

.table-clean th {
  color: #46627f;
  background: #f4f8fd;
  font-weight: 800;
}

.table-clean tr:last-child td {
  border-bottom: 0;
}

.table-note {
  color: var(--md-muted);
  font-size: 0.76rem;
}

.bed-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.bed-card {
  border: 1px solid #b7d0ec;
  background: linear-gradient(180deg, #f6faff 0%, #eff6ff 100%);
  border-radius: var(--radius-md);
  padding: 0.76rem;
  display: grid;
  gap: 0.35rem;
}

.bed-card h4 {
  margin: 0;
  font-size: 0.98rem;
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  border: 1px solid var(--md-border);
  padding: 0.18rem 0.52rem;
  background: #fff;
  font-size: 0.72rem;
  color: #466280;
}

.footer-shell {
  margin-top: auto;
  border-top: 1px solid var(--md-border);
  background: rgba(249, 252, 255, 0.9);
}

.footer-inner {
  width: min(1260px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0;
  color: var(--md-muted);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.footer-nav {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.footer-nav a {
  text-decoration: none;
  color: #2e557d;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.16rem 0.48rem;
}

.footer-nav a:hover {
  border-color: #d0dff2;
  background: #f0f6ff;
}

.loader-box {
  border: 1px dashed #b2cbe6;
  border-radius: var(--radius-md);
  padding: 0.95rem;
  color: var(--md-muted);
  text-align: center;
  background: #f7fbff;
}

@media (max-width: 1080px) {
  .section-row.columns-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .front-header-inner,
  .front-main,
  .footer-inner {
    width: calc(100% - 1rem);
  }

  .top-nav {
    display: none;
  }

  .section-row.columns-2,
  .section-row.columns-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .form-grid.two {
    grid-template-columns: 1fr;
  }

  .front-header-inner {
    padding: 0.32rem 0;
  }

  .brand-meta span {
    display: none;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-btn {
    flex: 1;
    justify-content: center;
  }
}
