/* JAL Engineering Services — shared styles. Mobile-first. */
:root {
  --brand: #0074C7;
  --brand-dark: #005a9b;
  --accent: #C00F2F;
  --ink: #1f2429;
  --ink-soft: #4A4F55;
  --muted: #7b838c;
  --line: #e2e6ea;
  --bg: #f4f6f8;
  --card: #ffffff;
  --ok: #157f4a;
  --ok-bg: #e7f6ed;
  --warn: #9a6200;
  --warn-bg: #fff6e0;
  --bad: #b3122c;
  --bad-bg: #fdecef;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16,24,32,.06), 0 6px 20px rgba(16,24,32,.05);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);

  /* Sticky footer: on a short page the credit is pushed to the bottom of the
     screen instead of floating under the card. dvh keeps it honest on phones
     whose address bar grows and shrinks. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

a { color: var(--brand); }

/* --- public shell ----------------------------------------------------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  text-align: center;
}
.topbar img { width: 100%; max-width: 300px; height: auto; display: inline-block; }
.topbar .tagline {
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.wrap { max-width: 640px; width: 100%; margin: 0 auto; padding: 16px;
        flex: 1 0 auto; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
  margin-bottom: 16px;
}

h1 { font-size: 21px; margin: 0 0 6px; line-height: 1.25; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.lede { color: var(--ink-soft); margin: 0 0 16px; font-size: 15px; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 0; }

.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--brand);
  margin: 0 0 14px;
}
.section-title::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

/* --- forms ------------------------------------------------------------ */
label.field { display: block; margin-bottom: 14px; }
label.field > span.lbl {
  display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px;
}
.req { color: var(--accent); }
.opt { color: var(--muted); font-weight: 400; font-size: 13px; }

input[type=text], input[type=tel], input[type=date], input[type=password],
input[type=number], select {
  width: 100%;
  padding: 12px 12px;
  font-size: 16px; /* keeps iOS from zooming on focus */
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid #ccd3da;
  border-radius: 10px;
  appearance: none;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0,116,199,.15);
}

/* Dialling code and number read as one control. */
.phone { display: flex; gap: 8px; }
.phone select {
  /* Wide enough that the dialling code - the part that matters - is never
     clipped; a long country name may truncate after it. */
  flex: 0 0 auto; width: auto; max-width: 50%;
  padding-left: 10px; padding-right: 26px;
  text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, #6b747d 50%),
                    linear-gradient(135deg, #6b747d 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.phone input { flex: 1 1 auto; min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 14px 16px;
  font-size: 16px; font-weight: 600; font-family: inherit;
  color: #fff; background: var(--brand);
  border: 0; border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { background: #a9b4be; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--brand); border: 1px solid #ccd3da; }
.btn.secondary:hover { background: #f3f8fc; }
.btn.danger { background: var(--accent); }
.btn.sm { width: auto; padding: 8px 12px; font-size: 14px; }

.alert {
  border-radius: 10px; padding: 12px 14px; margin-bottom: 16px;
  font-size: 14px; border: 1px solid transparent;
}
.alert.error { background: var(--bad-bg); border-color: #f6c3cd; color: var(--bad); }
.alert.ok { background: var(--ok-bg); border-color: #b8e2c8; color: var(--ok); }
.alert.info { background: #eaf4fc; border-color: #bfdcf2; color: var(--brand-dark); }

/* --- document rows ---------------------------------------------------- */
.doc {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fff;
}
.doc.done { background: var(--ok-bg); border-color: #b8e2c8; }
.doc-head { display: flex; align-items: flex-start; gap: 10px; }
.doc-head .tick {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff; background: #c4ccd4;
}
.doc.done .doc-head .tick { background: var(--ok); }
.doc-head .meta { flex: 1; min-width: 0; }
.doc-head .meta strong { display: block; font-size: 15px; }
.doc-head .meta .types { font-size: 12px; color: var(--muted); }
.doc-head .meta .dochint {
  display: block; font-size: 12px; color: var(--brand-dark); margin-top: 2px;
}

.filelist { list-style: none; margin: 10px 0 0; padding: 0; }
.filelist li {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; padding: 6px 0; border-top: 1px dashed var(--line);
  word-break: break-all;
}
.filelist li .nm { flex: 1; min-width: 0; }
.filelist li .sz { color: var(--muted); flex: 0 0 auto; }
.remove {
  background: none; border: 0; color: var(--accent);
  font-size: 13px; cursor: pointer; padding: 2px 4px; flex: 0 0 auto;
}

.picker { margin-top: 10px; }
.picker input[type=file] { display: none; }
.picker .pick {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; font-size: 14px; font-weight: 600;
  color: var(--brand); background: #f3f8fc;
  border: 1px dashed var(--brand); border-radius: 10px; cursor: pointer;
}
.picker .pick:hover { background: #e8f2fa; }

.bar { height: 6px; background: #e8ecef; border-radius: 99px; overflow: hidden;
       margin-top: 10px; display: none; }
.bar.show { display: block; }
.bar > i { display: block; height: 100%; width: 0; background: var(--brand);
           transition: width .15s linear; }
.upload-msg { font-size: 13px; margin-top: 6px; }
.upload-msg.err { color: var(--bad); }

.radio-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.radio-row label {
  flex: 1 1 120px; display: flex; align-items: center; gap: 8px;
  padding: 11px 12px; border: 1px solid #ccd3da; border-radius: 10px;
  font-size: 15px; background: #fff; cursor: pointer;
}
.radio-row input { accent-color: var(--brand); width: 18px; height: 18px; }
.radio-row label:has(input:checked) {
  border-color: var(--brand); background: #f3f8fc; font-weight: 600;
}

.dep {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; margin-bottom: 10px; background: #fafbfc;
}
.dep .dep-top { display: flex; justify-content: space-between; align-items: center;
                margin-bottom: 8px; }
.dep .dep-top b { font-size: 13px; color: var(--ink-soft); }

.declaration {
  display: flex; gap: 10px; align-items: flex-start;
  background: #fffdf5; border: 1px solid #f0e3bd; border-radius: 10px;
  padding: 12px; font-size: 14px; margin-bottom: 16px;
}
.declaration input { width: 20px; height: 20px; accent-color: var(--brand); flex: 0 0 auto; }

.identity {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 10px;
  background: #eaf4fc; border: 1px solid #bfdcf2; margin-bottom: 16px;
}
.identity .who { font-size: 13px; color: var(--brand-dark); }
.identity .who b { display: block; font-size: 17px; color: var(--ink); }

.progress-summary {
  display: flex; align-items: center; gap: 10px; font-size: 13px;
  color: var(--ink-soft); margin-bottom: 14px;
}
.progress-summary .track {
  flex: 1; height: 8px; background: #e8ecef; border-radius: 99px; overflow: hidden;
}
.progress-summary .track > i {
  display: block; height: 100%; background: var(--ok); width: 0;
}

.done-hero { text-align: center; padding: 28px 16px; }
.done-hero .big { font-size: 46px; line-height: 1; margin-bottom: 12px; }
.done-hero h1 { font-size: 22px; }

.footer { text-align: center; color: var(--muted); font-size: 12px;
          padding: 8px 16px 4px; flex-shrink: 0; }

/* Muscat Tech Solutions credit: logo and text on one line, centred, at the
   very bottom of every page. */
.credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 16px 30px;
  text-align: center;
  flex-shrink: 0;
}
.credit-logo { width: 24px; height: 24px; display: block; flex: 0 0 auto; opacity: .95; }
.credit-text { color: var(--muted); font-size: 12px; line-height: 1.4; }

/* Small handsets: shrink a little rather than wrap the credit onto two lines. */
@media (max-width: 374px) {
  .credit { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .credit-logo { width: 20px; height: 20px; }
  .credit-text { font-size: 11px; }
}


.sticky-submit {
  position: sticky; bottom: 0; background: linear-gradient(180deg,
     rgba(244,246,248,0) 0%, var(--bg) 40%);
  padding: 12px 0 16px;
}

@media (min-width: 560px) {
  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
}
