/* Tamkeen International — official-stationery look.
   Palette lifted from the company's printed identity:
   warm cream paper, charcoal ink, crimson accent. */

:root {
  --paper: #f2eee3;
  --card: #fbf9f2;
  --ink: #201f1d;
  --red: #be2a2e;
  --muted: #6e6659;
  --line: #d9d1be;
  --field-border: #c9c0aa;
  --field-bg: #fffefb;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

/* ---------- language toggle ---------- */

.lang-bar {
  display: flex;
  justify-content: flex-end;
  padding: 12px clamp(16px, 4vw, 48px) 0;
}

.lang-toggle {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 4px 14px;
  cursor: pointer;
}

.lang-toggle:hover { background: var(--ink); color: var(--paper); }

/* ---------- letterhead ---------- */

.letterhead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(16px, 3vw, 40px);
  align-items: start;
  padding: 16px clamp(16px, 4vw, 48px) 0;
  max-width: 1100px;
  margin: 0 auto;
}

.lh-block.lh-en { text-align: left; }
.lh-block.lh-ar { text-align: right; }

.lh-title {
  margin: 0;
  font-weight: 700;
  font-size: clamp(17px, 2.3vw, 26px);
  line-height: 1.25;
}

.lh-en .lh-title {
  font-family: 'Oswald', 'IBM Plex Sans Arabic', sans-serif;
  font-weight: 600;
  letter-spacing: 0.015em;
}

.lh-sub {
  margin: 4px 0 0;
  color: var(--red);
  font-weight: 600;
  font-size: clamp(11px, 1.4vw, 15px);
}

.lh-rule { height: 2px; background: var(--ink); margin-top: 14px; }

/* multiply blends the photo-scan's beige background into the page paper;
   remove once the real transparent-background logo replaces the crop */
.lh-logo img { height: clamp(96px, 12vw, 140px); display: block; mix-blend-mode: multiply; }

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

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 48px) clamp(16px, 4vw, 48px) 40px;
}

.intro h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  line-height: 1.2;
}

.lede { margin: 0 0 16px; color: var(--muted); max-width: 56ch; }

.free-notice {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin: 0 0 28px;
  padding: 10px 14px;
  border: 1px solid var(--red);
  border-inline-start: 4px solid var(--red);
  border-radius: 2px;
  background: var(--card);
  font-weight: 600;
  font-size: 14px;
}

.free-mark { color: var(--red); font-weight: 700; }

/* ---------- form as document ---------- */

.doc {
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: clamp(20px, 4vw, 36px);
}

.hp { position: absolute; left: -9999px; top: -9999px; }

fieldset {
  border: 0;
  margin: 0 0 28px;
  padding: 0;
}

legend {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0 0 10px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: 17px;
}

.sec-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--red);
  color: var(--card);
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  border-radius: 2px;
  flex: none;
}

.field { margin-bottom: 18px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

[dir="rtl"] .field label { text-transform: none; letter-spacing: 0; font-size: 14px; }

input[type="text"],
input[type="tel"],
select {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: 2px;
  padding: 10px 12px;
}

input[type="file"] {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--muted);
  background: var(--field-bg);
  border: 1px dashed var(--field-border);
  border-radius: 2px;
  padding: 10px 12px;
}

input[type="file"]::file-selector-button {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 5px 12px;
  margin-inline-end: 10px;
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover { background: var(--ink); color: var(--paper); }

input:focus-visible,
select:focus-visible,
button:focus-visible,
input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.field.invalid input,
.field.invalid select { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }

.hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.hint.warn { color: var(--red); font-weight: 600; }

/* ---------- consent + submit ---------- */

.consent {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-bottom: 18px;
  font-size: 14px;
}

.consent label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }

.consent input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--red);
  flex: none;
}

.form-error { color: var(--red); font-weight: 600; font-size: 14px; margin: 0 0 14px; }

.submit {
  display: block;
  width: 100%;
  font-family: 'Oswald', 'IBM Plex Sans Arabic', sans-serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 14px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

[dir="rtl"] .submit { letter-spacing: 0; text-transform: none; font-family: 'IBM Plex Sans Arabic', sans-serif; }

.submit:hover:not(:disabled) { background: var(--red); border-color: var(--red); }
.submit:disabled { opacity: 0.6; cursor: default; }

/* ---------- success ---------- */

.success {
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: clamp(28px, 6vw, 48px);
  text-align: center;
}

.stamp {
  display: inline-block;
  font-family: 'Oswald', 'IBM Plex Sans Arabic', sans-serif;
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--red);
  border: 3px solid var(--red);
  border-radius: 4px;
  padding: 8px 22px;
  transform: rotate(-4deg);
  margin-bottom: 20px;
}

[dir="rtl"] .stamp { letter-spacing: 0; transform: rotate(4deg); }

.success h2 { margin: 0 0 8px; font-size: 20px; }
.success p { margin: 0 auto; color: var(--muted); max-width: 48ch; }

/* ---------- footer ---------- */

.foot {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px) 48px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.foot-rule { height: 2px; background: var(--ink); margin-bottom: 16px; }
.foot-names { font-weight: 600; color: var(--ink); margin: 0 0 4px; }
.foot-legal { margin: 0 0 4px; }
.foot-free { margin: 0; }

/* ---------- responsive ---------- */

.hidden { display: none !important; }

@media (max-width: 700px) {
  .letterhead {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .lh-logo { order: -1; }
  .lh-block.lh-en, .lh-block.lh-ar { text-align: center; width: 100%; max-width: 420px; }
  .field-row { grid-template-columns: 1fr; }
}
