@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=Noto+Naskh+Arabic:wght@400;600;700&family=Source+Serif+4:opsz,wght@8..60,500;8..60,600;8..60,700&display=swap");

:root {
  --bg: #f4efe6;
  --bg-alt: #fbf8f2;
  --paper: rgba(255, 253, 249, 0.94);
  --paper-strong: #ffffff;
  --line: rgba(24, 50, 75, 0.12);
  --line-strong: rgba(24, 50, 75, 0.2);
  --navy-950: #18324b;
  --navy-800: #264d70;
  --navy-700: #35658f;
  --slate-700: #5b6674;
  --slate-500: #7a8592;
  --gold-500: #b78d32;
  --gold-300: #ecdcb8;
  --success: #1f7a58;
  --warning: #9a6a11;
  --danger: #a22d2f;
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--navy-950);
  font-family: "IBM Plex Sans", sans-serif;
  background: linear-gradient(180deg, var(--bg-alt), var(--bg));
}

body::before {
  display: none;
}

.shell {
  width: min(1140px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(251, 248, 242, 0.92);
  backdrop-filter: blur(8px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-title {
  margin: 0;
  color: var(--navy-950);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand-subtitle {
  margin: 0;
  color: var(--slate-700);
  font-size: 0.82rem;
}

.header-note {
  color: var(--navy-800);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.action-link {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.68);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--navy-950);
  font-size: 0.84rem;
  font-weight: 600;
}

.header-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--navy-950);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.header-link:hover,
.header-link:focus-visible,
.primary-link:hover,
.primary-link:focus-visible,
.primary-button:hover,
.primary-button:focus-visible,
.download-pill:hover,
.download-pill:focus-visible,
.text-link:hover,
.text-link:focus-visible {
  opacity: 0.82;
}

.shell-home,
.shell-job {
  padding: 34px 0 68px;
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 160px);
  padding: 44px 0;
}

.auth-card {
  width: min(560px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.88);
}

.auth-title,
.admin-title {
  max-width: none;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  line-height: 0.98;
}

.auth-copy,
.admin-copy {
  max-width: 58ch;
  margin: 14px 0 0;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.auth-actions {
  display: flex;
  justify-content: flex-start;
}

.hero {
  display: grid;
  gap: 32px;
}

.hero-home {
  grid-template-columns: minmax(0, 1.36fr) minmax(260px, 0.64fr);
  align-items: start;
  padding: 22px 0 24px;
}

.hero-job {
  grid-template-columns: minmax(0, 1.14fr) minmax(280px, 0.86fr);
  align-items: start;
  padding: 10px 0 24px;
}

.hero-job h1 {
  max-width: none;
  font-size: clamp(2.4rem, 4.2vw, 3.8rem);
  line-height: 0.98;
}

.eyebrow,
.section-label {
  margin: 0 0 14px;
  color: var(--navy-700);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--navy-950);
}

h1 {
  max-width: 8.6ch;
  font-family: "Source Serif 4", serif;
  font-size: clamp(3.1rem, 6vw, 4.8rem);
  line-height: 0.93;
  font-weight: 600;
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(1.16rem, 1.8vw, 1.52rem);
  line-height: 1.22;
  font-weight: 600;
}

.lede {
  max-width: 42ch;
  margin: 16px 0 0;
  color: var(--navy-800);
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.65;
}

.hero-support,
.muted {
  color: var(--slate-700);
  line-height: 1.72;
}

.hero-support {
  max-width: 52ch;
  margin: 16px 0 0;
  font-size: 0.98rem;
}

.hero-actions {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.primary-link,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 0;
  padding: 13px 18px;
  border: none;
  border-radius: 12px;
  background: var(--navy-950);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 140ms ease, background 140ms ease;
}

.primary-link:hover,
.primary-button:hover {
  background: var(--navy-800);
}

.process-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  color: var(--slate-700);
  font-size: 0.9rem;
}

.process-line span {
  position: relative;
  padding-right: 18px;
}

.process-line span:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  border-radius: 50%;
  background: rgba(38, 77, 112, 0.35);
}

.tag-row,
.download-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag,
.meta-chip,
.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--navy-800);
  font-size: 0.84rem;
  font-weight: 600;
}

.discipline-panel {
  align-self: stretch;
  padding: 10px 0 0 24px;
  border-left: 1px solid var(--line);
}

.discipline-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 18px;
  border: 1px solid rgba(183, 141, 50, 0.25);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.discipline-mark img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.discipline-list {
  display: grid;
  gap: 18px;
  margin: 0;
}

.discipline-item {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.discipline-item:first-child {
  padding-top: 0;
  border-top: none;
}

.discipline-item dt {
  color: var(--slate-500);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.discipline-item dd {
  margin: 0;
  color: var(--navy-950);
  line-height: 1.7;
}

.reflection-callout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  margin: 0 0 28px;
  padding: 22px 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}

.inline-banner {
  margin: 0 0 22px;
  padding: 14px 16px;
  border: 1px solid rgba(31, 122, 88, 0.18);
  border-radius: var(--radius-md);
  background: rgba(31, 122, 88, 0.08);
  color: var(--success);
  font-weight: 600;
}

.inline-banner-success {
  border-color: rgba(31, 122, 88, 0.18);
  background: rgba(31, 122, 88, 0.08);
  color: var(--success);
}

.inline-banner-error {
  border-color: rgba(162, 45, 47, 0.16);
  background: rgba(162, 45, 47, 0.08);
  color: var(--danger);
}

.reflection-copy {
  max-width: 84ch;
  margin: 0;
  color: var(--navy-950);
  font-size: 0.98rem;
  line-height: 1.78;
}

.reflection-copy strong {
  color: var(--navy-800);
}

.content-layout {
  display: block;
}

.card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--paper);
}

.form-card {
  background: rgba(255, 255, 255, 0.86);
  max-width: 920px;
  margin: 0 auto;
}

.note-panel {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(183, 141, 50, 0.25);
  border-radius: var(--radius-lg);
  background: rgba(236, 220, 184, 0.24);
}

.warning-panel {
  border-color: rgba(183, 141, 50, 0.38);
  background: rgba(236, 220, 184, 0.32);
  color: var(--navy-950);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.form-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.field {
  display: grid;
  gap: 10px;
}

.field-label {
  color: var(--navy-950);
  font-weight: 600;
}

.field-hint {
  color: var(--slate-500);
  font-size: 0.88rem;
  line-height: 1.55;
}

.full {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper-strong);
  color: var(--navy-950);
  font: inherit;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input::file-selector-button {
  margin-right: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(38, 77, 112, 0.06);
  color: var(--navy-950);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

textarea {
  min-height: 164px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(38, 77, 112, 0.34);
  box-shadow: 0 0 0 4px rgba(38, 77, 112, 0.08);
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.form-note {
  max-width: 48ch;
  color: var(--slate-700);
  font-size: 0.95rem;
  line-height: 1.72;
}

.feature-list,
.sequence-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  color: var(--slate-700);
}

.feature-list li,
.sequence-list li {
  position: relative;
  margin-bottom: 14px;
  padding-left: 18px;
  line-height: 1.68;
}

.feature-list li::before,
.sequence-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(38, 77, 112, 0.35);
}

.status-chip {
  text-transform: capitalize;
}

.status-queued {
  color: var(--warning);
  background: rgba(183, 141, 50, 0.12);
  border-color: rgba(183, 141, 50, 0.2);
}

.status-processing {
  color: var(--navy-700);
  background: rgba(53, 101, 143, 0.1);
  border-color: rgba(53, 101, 143, 0.18);
}

.status-completed {
  color: var(--success);
  background: rgba(31, 122, 88, 0.1);
  border-color: rgba(31, 122, 88, 0.18);
}

.status-failed {
  color: var(--danger);
  background: rgba(162, 45, 47, 0.1);
  border-color: rgba(162, 45, 47, 0.16);
}

.alert {
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(162, 45, 47, 0.16);
  border-radius: var(--radius-md);
  background: rgba(162, 45, 47, 0.08);
  color: var(--danger);
  font-weight: 700;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 24px;
}

.single-column-section {
  margin-top: 24px;
}

.admin-grid {
  align-items: start;
}

.admin-hero {
  margin-bottom: 24px;
}

.log-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.log-list li {
  display: grid;
  gap: 6px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(24, 50, 75, 0.08);
  color: var(--slate-700);
}

.log-list li:last-child {
  border-bottom: none;
}

.log-list strong {
  color: var(--navy-950);
  font-size: 0.92rem;
}

.download-pill,
.text-link {
  text-decoration: none;
}

.download-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--navy-950);
  font-weight: 600;
}

.text-link {
  color: var(--navy-700);
  font-weight: 700;
}

.users-table {
  display: grid;
  gap: 16px;
}

.user-row {
  display: grid;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.user-row:first-child {
  padding-top: 0;
  border-top: none;
}

.user-row-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.user-row-meta,
.user-row-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-password-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-password-form input {
  width: min(220px, 100%);
}

.preview {
  margin: 18px 0 0;
  max-height: 580px;
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.84);
  color: var(--slate-700);
  white-space: pre-wrap;
  line-height: 1.9;
}

.rtl {
  direction: rtl;
  font-family: "Noto Naskh Arabic", serif;
  font-size: 1.08rem;
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(24, 50, 75, 0.06);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

@media (max-width: 1024px) {
  .hero-home,
  .hero-job,
  .content-layout,
  .grid-two,
  .reflection-callout {
    grid-template-columns: 1fr;
  }

  .discipline-panel {
    padding-left: 0;
    border-left: none;
  }
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 20px, 1140px);
  }

  .site-header-inner,
  .card-header,
  .form-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions,
  .user-row-main {
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 22px;
  }

  .shell-home,
  .shell-job {
    padding: 28px 0 56px;
  }

  h1 {
    max-width: 9ch;
    font-size: clamp(2.7rem, 14vw, 4rem);
  }

  .auth-title,
  .admin-title {
    max-width: none;
  }
}
