/* ===================================================================
   Fime · Mastercard M-TIP Order Form
   Brand palette: Navy #123940 / Teal #00E4C5 / Mint #C7F9ED
   Headings: Georgia (serif)  ·  Body: Arial / system sans
   =================================================================== */

:root {
  --navy: #123940;
  --navy-700: #0d2a2f;
  --navy-soft: #1c4d55;
  --teal: #00E4C5;
  --teal-deep: #00b39a;
  --mint: #C7F9ED;
  --mint-50: #effdf9;
  --mint-input: #d7f7ee;
  --ink: #14282b;
  --muted: #5c7177;
  --line: #d7e3e2;
  --line-soft: #e9f1f0;
  --bg: #eef3f3;
  --white: #ffffff;
  --req: #d8453a;
  --shadow: 0 6px 24px rgba(18, 57, 64, 0.10);
  --shadow-lg: 0 18px 48px rgba(18, 57, 64, 0.22);
  --radius: 12px;
}

* { box-sizing: border-box; }

/* The hidden attribute must always win over component display rules
   (e.g. .modal-overlay{display:grid}, .field{display:flex}). */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1100px 480px at 100% -10%, rgba(0, 228, 197, 0.10), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--navy);
  margin: 0;
  letter-spacing: 0.1px;
}

a { color: var(--teal-deep); }

.app {
  max-width: 980px;
  margin: 28px auto 56px;
  padding: 0 20px;
}

/* ===================== MASTHEAD ===================== */
.masthead {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-soft) 100%);
  color: #eafcf8;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 26px 30px 22px;
  position: relative;
  overflow: hidden;
}
.masthead::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(0, 228, 197, 0.28), transparent 70%);
}
.masthead-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.brand { display: flex; align-items: center; gap: 16px; }
.brand-logo {
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 30px;
  color: var(--teal);
  letter-spacing: -1px;
}
.brand-sep { width: 1px; height: 28px; background: rgba(255,255,255,0.25); }
.brand-title {
  font-family: Georgia, serif;
  font-size: 19px;
  color: #ffffff;
}
.masthead-meta { display: flex; gap: 26px; flex-wrap: wrap; }
.meta-item { display: flex; flex-direction: column; }
.meta-k {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--teal);
  font-weight: bold;
}
.meta-v { font-size: 13px; color: #def6f1; }
.masthead-note {
  position: relative;
  z-index: 1;
  margin: 18px 0 0;
  font-size: 12.5px;
  color: #c4e7e1;
}
.masthead-note a { color: var(--teal); }

/* ===================== STEPPER ===================== */
.stepper {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 16px 20px;
  overflow-x: auto;
}
.stepper ol {
  list-style: none;
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  min-width: max-content;
}
.stepper li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  transition: all .2s ease;
}
.stepper li .dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--line-soft);
  color: var(--muted);
  font-weight: bold;
  font-size: 12px;
  border: 1px solid var(--line);
}
.stepper li.active {
  background: var(--mint-50);
  color: var(--navy);
  font-weight: bold;
}
.stepper li.active .dot {
  background: var(--teal);
  color: var(--navy);
  border-color: var(--teal);
}
.stepper li.done .dot {
  background: var(--navy);
  color: var(--teal);
  border-color: var(--navy);
}
.stepper li.done .dot::after { content: "✓"; }
.stepper li.done .dot { font-size: 0; }
.stepper li.done .dot::after { font-size: 12px; }

/* ===================== FORM CARD ===================== */
#orderForm {
  background: var(--white);
  box-shadow: var(--shadow);
}
.step { padding: 30px; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px);} to {opacity:1; transform:none;} }

.step-head { margin-bottom: 22px; padding-bottom: 16px; border-bottom: 2px solid var(--mint); }
.step-head h2 { font-size: 23px; }
.step-head p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }

.section-band {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--white);
  background: var(--navy);
  padding: 9px 14px;
  border-radius: 6px;
  margin: 26px 0 16px;
}

/* ===================== FIELDS ===================== */
.grid { display: grid; gap: 18px 22px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.field { display: flex; flex-direction: column; }
.field-wide { grid-column: 1 / -1; }

.field-label {
  font-size: 13px;
  font-weight: bold;
  color: var(--navy);
  margin-bottom: 6px;
}
.req { color: var(--req); font-weight: bold; }
.opt { color: var(--muted); font-weight: normal; font-size: 11.5px; }
.hint { margin: 0 0 7px; font-size: 11.5px; color: var(--muted); line-height: 1.4; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--mint-input);
  border: 1px solid #aee4d7;
  border-radius: 8px;
  padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder { color: #7fa7a0; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal-deep);
  box-shadow: 0 0 0 3px rgba(0, 228, 197, 0.25);
  background: #fff;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23123940' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
.field.invalid input,
.field.invalid select {
  border-color: var(--req);
  background: #fdf1f0;
  box-shadow: 0 0 0 3px rgba(216, 69, 58, 0.12);
}

/* option chips (checkbox groups) */
.options-row { display: flex; gap: 10px; flex-wrap: wrap; }
.opt-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid #aee4d7;
  border-radius: 8px;
  background: var(--mint-input);
  font-size: 13.5px;
  cursor: pointer;
  user-select: none;
  transition: all .15s;
}
.opt-chip:hover { border-color: var(--teal-deep); }
.opt-chip input { accent-color: var(--teal-deep); width: 16px; height: 16px; }

/* same-as toggle */
.same-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--mint-50);
  border: 1px solid var(--mint);
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 13.5px;
  cursor: pointer;
}
.same-toggle input { accent-color: var(--teal-deep); width: 17px; height: 17px; }

.callout {
  background: var(--mint-50);
  border-left: 4px solid var(--teal);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  font-size: 12.5px;
  color: var(--navy-soft);
  margin-bottom: 16px;
}

/* ===================== ORDER TABLE ===================== */
.order-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.order-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.order-table thead th {
  background: var(--navy);
  color: #fff;
  text-align: left;
  padding: 11px 14px;
  font-weight: bold;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.order-table th.sla, .order-table th.units { text-align: center; }
.order-table td { padding: 10px 14px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.order-table td.sla { text-align: center; color: var(--muted); white-space: nowrap; }
.order-table td.units { text-align: center; width: 110px; }
.order-table td.units input { text-align: center; padding: 7px; }
.order-table .group-row td {
  background: var(--mint-50);
  font-weight: bold;
  color: var(--navy);
  text-transform: uppercase;
  font-size: 11.5px;
  letter-spacing: .5px;
}
.group-note { font-weight: normal; text-transform: none; color: var(--muted); font-size: 11px; }

.fee-indication {
  margin-top: 18px;
  background: var(--navy);
  color: #eafcf8;
  border-radius: 10px;
  padding: 16px 20px;
}
.fee-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13.5px; }
.fee-row.total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.2);
  font-family: Georgia, serif;
  font-size: 16px;
  color: var(--teal);
}

/* ===================== REVIEW ===================== */
.review { display: flex; flex-direction: column; gap: 22px; }
.review-group { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.review-group h4 {
  margin: 0;
  background: var(--mint-50);
  color: var(--navy);
  font-family: Georgia, serif;
  font-size: 15px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}
.review-rows { display: grid; grid-template-columns: 1fr 1fr; }
.review-row {
  display: flex; flex-direction: column;
  padding: 10px 16px;
  border-top: 1px solid var(--line-soft);
}
.review-row:nth-child(-n+2) { border-top: none; }
.review-k { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.review-v { font-size: 14px; color: var(--ink); word-break: break-word; }
.review-v.empty { color: #b3c4c2; font-style: italic; }

/* ===================== TERMS & CONDITIONS ===================== */
.tc-box {
  height: 360px;
  overflow-y: scroll;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdfc;
  padding: 22px 26px;
  box-shadow: inset 0 2px 10px rgba(18,57,64,0.05);
}
.tc-box:focus { outline: 2px solid var(--teal); outline-offset: 2px; }
.tc-content { font-size: 13px; line-height: 1.65; color: #2a3f43; }
.tc-content h3 { font-size: 16px; margin: 0 0 6px; }
.tc-content h4 { font-family: Georgia, serif; color: var(--navy); font-size: 13.5px; margin: 18px 0 5px; }
.tc-content p { margin: 0 0 10px; }
.tc-content .tc-meta { color: var(--muted); font-size: 11.5px; margin-bottom: 16px; }
.tc-content ul { margin: 0 0 10px; padding-left: 20px; }
.tc-content li { margin-bottom: 5px; }
.tc-end { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--teal-deep); font-weight: bold; font-size: 12px; }

.tc-scrollhint {
  font-size: 12px;
  color: var(--req);
  margin: 8px 0 0;
  transition: opacity .3s;
}
.tc-scrollhint.read { color: var(--teal-deep); }

.acceptance { margin: 20px 0 8px; }
.agree {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--mint-50);
  border: 1px solid var(--mint);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--navy-soft);
  cursor: pointer;
}
.agree input {
  margin-top: 2px;
  width: 18px; height: 18px;
  accent-color: var(--teal-deep);
  flex-shrink: 0;
}
.agree input:disabled { cursor: not-allowed; }

/* signatures */
.signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}
.sig-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  min-height: 170px;
  display: flex;
  flex-direction: column;
}
.sig-customer { background: var(--mint-50); border-color: var(--mint); }
.sig-role { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 12px; }
.sig-name { font-size: 15px; font-weight: bold; color: var(--navy); }
.sig-title { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.sig-mark {
  font-family: "Segoe Script", "Bradley Hand", "Brush Script MT", cursive;
  font-size: 30px;
  color: #1d3c8a;
  margin: 12px 0 4px;
  line-height: 1;
}
.sig-mark-fime { color: #1d3c8a; }
.sig-meta { font-size: 11px; color: var(--muted); margin-top: auto; }
.sig-prompt { color: var(--muted); font-size: 13px; margin: 0 0 12px; }

/* ===================== BUTTONS ===================== */
.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: bold;
  padding: 11px 22px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s ease;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-700); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { background: var(--mint-50); }
.btn-submit { background: var(--teal); color: var(--navy); }
.btn-submit:hover:not(:disabled) { background: var(--teal-deep); color: #fff; }
.btn-submit:not(:disabled) { box-shadow: 0 4px 14px rgba(0, 228, 197, 0.45); }
.btn-sign {
  background: #fff;
  color: var(--navy);
  border: 1.5px dashed var(--teal-deep);
}
.btn-sign:hover:not(:disabled) { background: var(--mint); }
.btn-link {
  background: none; border: none;
  color: var(--teal-deep);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  margin-top: 8px;
  align-self: flex-start;
}

.form-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 30px;
  border-top: 1px solid var(--line);
  background: #fbfdfc;
  border-radius: 0 0 var(--radius) var(--radius);
}
.nav-spacer { flex: 1; }
.step-counter { font-size: 12.5px; color: var(--muted); }

.app-footer { text-align: center; margin-top: 18px; }
.app-footer p { font-size: 11px; color: var(--muted); }

/* ===================== MODALS ===================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(13, 42, 47, 0.55);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 20px;
  animation: fade .2s ease;
}
.modal {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
}
.modal h3 { font-size: 20px; margin-bottom: 6px; }
.modal-sub { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.modal .field { margin-bottom: 14px; }
.modal-disclaimer {
  font-size: 11.5px;
  color: #9a6a00;
  background: #fff7e6;
  border: 1px solid #ffe3a6;
  border-radius: 8px;
  padding: 9px 12px;
  margin: 6px 0 18px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; }
.modal-actions.center { justify-content: center; }

.modal-success { text-align: center; max-width: 440px; }
.success-check {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--navy);
  font-size: 34px;
  display: grid; place-items: center;
  margin: 0 auto 16px;
  box-shadow: 0 8px 22px rgba(0,228,197,.4);
}
.modal-success p { color: var(--muted); font-size: 13.5px; }
.modal-success strong { color: var(--navy); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
  .signatures { grid-template-columns: 1fr; }
  .review-rows { grid-template-columns: 1fr; }
  .review-row:nth-child(2) { border-top: 1px solid var(--line-soft); }
  .masthead-meta { gap: 16px; }
  .step { padding: 22px 18px; }
  .stepper li .lbl { display: none; }
  .stepper li { padding: 6px; }
  .form-nav { flex-wrap: wrap; }
  .step-counter { order: -1; width: 100%; text-align: center; }
}
