/* pagamentos.emviagem.pt — página de pagamento por file. Mobile primeiro. */
:root {
  color-scheme: light;
  --ink: #173847;
  --orange: #ff7900;
  --orange-dark: #c25400;
  --paper: #fffdf9;
  --line: #dbe2df;
  --muted: #61717a;
  --success: #17794f;
  --success-bg: #edf8f2;
  --danger: #b64032;
  --danger-bg: #fff2ef;
  --warn-bg: #fff6e8;
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: linear-gradient(160deg, #f6f2ea, #f9fbfa 45%, #edf4f2) fixed;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---- topo ---- */
.pg-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 18px 0 6px; }
/* O logo tem fundo branco: "multiply" faz o branco desaparecer sobre o fundo claro da página. */
.pg-brand img { display: block; width: 130px; height: auto; mix-blend-mode: multiply; }
.pg-top-tag { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .8rem; font-weight: 700; letter-spacing: .04em; }
.pg-lock { width: 12px; height: 14px; border: 2px solid var(--success); border-radius: 3px; position: relative; margin-top: 5px; }
.pg-lock::before { content: ""; position: absolute; left: 1px; top: -8px; width: 6px; height: 7px; border: 2px solid var(--success); border-bottom: 0; border-radius: 5px 5px 0 0; }

.pg-main { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 14px 0 56px; display: grid; gap: 16px; }

/* ---- introdução ---- */
.pg-intro { padding: 14px 2px 6px; }
.pg-kicker { margin: 0 0 10px; color: var(--orange-dark); font-size: .74rem; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.pg-intro h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 7vw, 3.3rem); font-weight: 500; letter-spacing: -.045em; line-height: 1; }
.pg-intro h1 em { color: var(--orange-dark); font-style: italic; }
.pg-lead { max-width: 560px; margin: 16px 0 0; color: var(--muted); font-size: 1.04rem; line-height: 1.6; }

/* ---- avisos ---- */
.pg-banner { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-left: 4px solid var(--success); border-radius: 4px var(--radius) var(--radius) 4px; background: var(--success-bg); }
.pg-banner strong { display: block; }
.pg-banner span { display: block; margin-top: 3px; color: var(--muted); font-size: .93rem; }
.pg-banner.is-error { border-left-color: var(--danger); background: var(--danger-bg); }
.pg-banner.is-warn { border-left-color: var(--orange); background: var(--warn-bg); }

/* ---- cartões ---- */
.pg-card { padding: clamp(20px, 5vw, 32px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 18px 46px rgba(27, 58, 66, .08); }
.pg-h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; font-weight: 500; letter-spacing: -.02em; }
.pg-hint { margin: 8px 0 0; color: var(--muted); font-size: .95rem; }
.pg-label { margin: 0; color: var(--muted); font-size: .76rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

/* ---- resumo do pedido ---- */
.pg-summary { border-top: 4px solid var(--orange); }
.pg-amount { margin: 6px 0 4px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.6rem, 11vw, 4rem); letter-spacing: -.04em; line-height: 1; }
.pg-facts { display: grid; gap: 0; margin: 18px 0 0; border-top: 1px solid var(--line); }
.pg-facts div { display: flex; justify-content: space-between; gap: 18px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.pg-facts dt { color: var(--muted); font-size: .9rem; }
.pg-facts dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }

/* ---- métodos ---- */
.pg-methods { display: grid; gap: 16px; }
.pg-method-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 14px; }
.pg-badge { padding: 4px 10px; border-radius: 99px; background: #fff0e0; color: var(--orange-dark); font-size: .72rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.pg-note { margin: 12px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.pg-muted-box { padding: 14px 16px; border-radius: 12px; background: #f3f6f5; color: var(--muted); font-size: .95rem; }

.pg-entities .pg-hint { margin: 0 0 12px; }
.pg-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* Revtag da Revolut: em grande, é o que o cliente com Revolut copia ou toca. */
.pg-revtag { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.pg-revtag-value { min-width: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.7rem, 7vw, 2.3rem); letter-spacing: -.02em; overflow-wrap: anywhere; }
.pg-entity { padding: 8px 14px; border: 1px solid var(--line); border-radius: 99px; background: #fff; font-weight: 700; font-size: .9rem; cursor: pointer; }
.pg-entity[aria-checked="true"] { border-color: var(--orange); background: #fff0e0; color: var(--orange-dark); }

.pg-rows { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.pg-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.pg-row:last-child { border-bottom: 0; }
.pg-row-label { grid-column: 1 / -1; color: var(--muted); font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.pg-row-value { min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.pg-row-value.is-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.04rem; letter-spacing: .02em; }
.pg-copy { min-height: 38px; padding: 0 14px; border: 1px solid var(--ink); border-radius: 10px; background: transparent; font-size: .85rem; font-weight: 800; cursor: pointer; }
.pg-copy.is-done { border-color: var(--success); background: var(--success-bg); color: var(--success); }

/* ---- botões e campos ---- */
.pg-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 0 22px; border: 0; border-radius: 12px; background: var(--orange); color: #fff; font-weight: 800; font-size: 1.02rem; text-decoration: none; cursor: pointer; }
.pg-button:hover { background: #ec7000; }
.pg-button[disabled] { opacity: .6; cursor: progress; }
.pg-button.is-secondary { border: 1px solid var(--ink); background: transparent; color: var(--ink); }

.pg-grid { display: grid; gap: 14px; margin-top: 16px; }
.pg-field { display: grid; gap: 6px; font-size: .88rem; font-weight: 700; }
.pg-field input, .pg-field select, .pg-field textarea { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid #c8d2cf; border-radius: 10px; background: #fff; font-weight: 400; font-size: 1rem; }
.pg-field textarea { min-height: 76px; resize: vertical; }
.pg-field input:focus-visible, .pg-field select:focus-visible, .pg-field textarea:focus-visible, .pg-button:focus-visible, .pg-copy:focus-visible, .pg-entity:focus-visible { outline: 3px solid rgba(255, 121, 0, .45); outline-offset: 2px; }
.pg-field small { color: var(--muted); font-weight: 400; font-size: .82rem; }
.pg-field input[type="file"] { padding: 10px; }
.pg-opt { color: var(--muted); font-weight: 400; font-size: .8rem; }
.pg-field + .pg-field, .pg-grid + .pg-field { margin-top: 14px; }
.pg-field.has-error input, .pg-field.has-error select { border-color: var(--danger); }

.pg-consent { margin: 14px 0 16px; color: var(--muted); font-size: .84rem; }
.pg-status { min-height: 1.4em; margin: 12px 0 0; font-size: .93rem; }
.pg-status.is-error { color: var(--danger); font-weight: 700; }

/* ---- comprovativo enviado ---- */
.pg-done { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 12px; background: var(--success-bg); }
.pg-done p { margin: 4px 0 0; color: var(--muted); font-size: .95rem; }
.pg-done-mark { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: var(--success); color: #fff; font-weight: 900; line-height: 28px; text-align: center; }

/* ---- ajuda ---- */
.pg-help { padding: 6px 4px 0; color: var(--muted); font-size: .9rem; }
.pg-help p { margin: 0 0 10px; }
.pg-warning { padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); }
.pg-legal { display: flex; flex-wrap: wrap; gap: 16px; font-size: .84rem; }
.pg-legal a { font-weight: 700; color: var(--ink); }

@media (min-width: 640px) {
  .pg-grid { grid-template-columns: 1fr 1fr; }
  .pg-row { grid-template-columns: 150px minmax(0, 1fr) auto; }
  .pg-row-label { grid-column: auto; }
  .pg-button { width: auto; min-width: 280px; }
  .pg-button.is-block { width: 100%; }
}
