:root {
  --brand: #3476c4;
  --brand-dark: #084d90;
  --accent: #14a38b;
  --ink: #152238;
  --muted: #64748b;
  --line: #d9e2ef;
  --surface: #ffffff;
  --page: #f5f8fc;
  --danger: #b42318;
  font-family: "Noto Naskh Arabic UI", "Noto Naskh Arabic", "Cairo",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 44px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  text-decoration: none;
}

.brand span {
  color: var(--brand);
}

.close,
.back {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 24px;
  text-decoration: none;
  cursor: pointer;
}

.shell {
  width: min(1080px, calc(100% - 28px));
  margin: 28px auto 48px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(30, 97, 175, 0.08);
}

.intent-card {
  padding: clamp(20px, 4vw, 36px);
}

.eyebrow,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #eaf1f8;
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 14px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.25;
}

p {
  color: var(--muted);
}

.intent-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.intent-option {
  min-height: 170px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff !important;
  color: var(--ink);
  text-align: right;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.intent-option:hover,
.intent-option:focus-visible {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: 0 14px 30px rgba(52, 118, 196, 0.14);
  outline: none;
}

.intent-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: #eaf1f8;
  font-size: 24px;
}

.intent-option b,
.intent-option strong,
.intent-option small {
  display: block;
}

.intent-option b {
  margin-bottom: 4px;
  font-size: 22px;
  color: var(--ink);
}

.intent-option strong {
  margin-bottom: 8px;
  color: var(--brand-dark);
  font-size: 15px;
}

.intent-option small {
  color: var(--muted);
  line-height: 1.7;
}

.form-card {
  padding: clamp(18px, 4vw, 32px);
}

.form-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.form-section {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff !important;
  font: inherit;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(52, 118, 196, 0.12);
  outline: none;
}

.detect-status,
.category-chooser,
.counter,
.field small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

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

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

.upload-box {
  display: grid;
  place-items: center;
  min-height: 150px;
  border: 1px dashed #9db5d1;
  border-radius: 8px;
  background: #f8fbff;
  text-align: center;
  cursor: pointer;
}

.submit {
  width: 100%;
  min-height: 54px;
  margin-top: 18px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.submit:hover {
  background: var(--brand-dark);
}

.form-message:not(:empty) {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff1f0;
  color: var(--danger);
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .intent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 1080px);
    margin-top: 18px;
  }
  .intent-grid,
  .fields-grid {
    grid-template-columns: 1fr;
  }
  .intent-option {
    min-height: 148px;
  }
  .field.full {
    grid-column: auto;
  }
}
