/* Connectional — Trámites personales: airmail envelope + shipping label request. Loads after site.css and cert.css. */

:root { --airmail-w: 14px; }

/* ---------- Envelope ---------- */
.env-stage { position: relative; padding: 44px 0 56px; display: flex; justify-content: center; }
.envelope { position: relative; width: min(100%, 470px); padding: 12px; border-radius: 6px; transform: rotate(1.6deg);
  background: repeating-linear-gradient(-45deg, var(--rojo) 0 16px, #fff 16px 24px, var(--azul) 24px 40px, #fff 40px 48px);
  box-shadow: 0 1px 0 var(--paper-edge), 0 2px 4px rgba(0,0,0,.16), 0 30px 60px -22px rgba(0,0,0,.6);
  transition: transform 700ms var(--ease-out); }
.env-body { position: relative; background: var(--paper); border-radius: 3px; padding: 18px 20px 18px; }
.env-from { display: flex; align-items: center; gap: 12px; padding-right: 96px; min-height: 52px; }
.env-from .logo { height: 24px; }
.env-from small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); line-height: 1.4; }
.env-from b { display: block; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--ink-print); text-transform: none; }

/* Back flap: open above the top edge; folds shut on dispatch */
.env-flap { position: absolute; left: 26px; right: 26px; bottom: calc(100% - 1px); height: 38px; clip-path: polygon(0 100%, 50% 0, 100% 100%); transform-origin: 50% 100%; backface-visibility: hidden;
  background: repeating-linear-gradient(-45deg, var(--rojo) 0 16px, #fff 16px 24px, var(--azul) 24px 40px, #fff 40px 48px); transition: transform 520ms var(--ease-in-out); }
.env-flap::after { content: ""; position: absolute; inset: 9px 18px 0; clip-path: polygon(0 100%, 50% 0, 100% 100%); background: #e9e3d6; }
.envelope.is-sent .env-flap { transform: perspective(500px) rotateX(180deg); }

/* Postage stamp: perforated edge from a radial-gradient background, isotipo inside */
.postage { position: absolute; top: 12px; right: 14px; width: 72px; height: 86px; padding: 6px; transform: rotate(4deg); background: radial-gradient(circle, transparent 2.4px, #fff 2.9px) -4.5px -4.5px / 9px 9px; filter: drop-shadow(0 1px 1px rgba(16,23,63,.3)); }
.postage-in { display: grid; place-items: center; align-content: center; gap: 4px; width: 100%; height: 100%; background: var(--azul); color: #fff; text-align: center; }
.postage-in .iso { width: 38px; height: 34px; }
.postage-in .iso .lg-mark { fill: #fff; }
.postage-in .iso .lg-pulse, .postage-in .iso .lg-node { fill: #ff8f94; }
.postage-in .iso .lg-halo { stroke: #ff8f94; }
.postage-in small { font-size: 9.5px; font-weight: 800; letter-spacing: .12em; }

/* Postmark: appears on dispatch */
.postmark { position: absolute; top: 34px; right: 54px; width: 150px; height: 82px; opacity: 0; pointer-events: none; z-index: 3; mix-blend-mode: multiply; }
.postmark svg { width: 100%; height: 100%; overflow: visible; }
.postmark .pm-ink { fill: none; stroke: var(--rojo); }
.postmark text { fill: var(--rojo); font: 800 10px var(--font-sans); letter-spacing: .1em; }

/* ---------- Shipping label (the form) ---------- */
.label { position: relative; margin-top: 14px; border: 1.5px solid var(--ink-print); border-radius: 4px; background: #fff; overflow: hidden; }
.label-head { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1.5px solid var(--ink-print); }
.label-head p { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-print); }
.label-head .guia { text-align: right; }
.label-head .guia small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); }
.label-head .guia b.is-blank, .guia b.is-blank { color: var(--ink-muted); letter-spacing: .08em; }
.label-head .guia b { display: block; font-size: 15px; font-weight: 800; color: var(--rojo); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.barcode { display: block; height: 30px; padding: 6px 16px 0; }
.barcode svg { display: block; width: 100%; height: 24px; }
.barcode rect { fill: var(--ink-print); }
.barcode svg:empty { background: repeating-linear-gradient(90deg, var(--line-control) 0 5px, transparent 5px 9px) left bottom / 100% 1.5px no-repeat; }
.label.is-sent .barcode svg { animation: print 620ms 120ms var(--ease-out) both; }
.label.is-sent .label-head .guia b { animation: ink 360ms var(--ease-out) both; }
@keyframes print { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes ink { from { opacity: 0; filter: blur(2px); } to { opacity: 1; filter: none; } }
.label-steps { display: flex; border-bottom: 1px solid var(--rule); }
.label-steps span { flex: 1; padding: 8px 16px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); }
.label-steps span[aria-current="step"] { color: var(--azul); box-shadow: inset 0 -2px 0 var(--azul); }
.label-track { display: flex; align-items: flex-start; width: 200%; overflow: hidden; transition: transform 560ms var(--ease-in-out); }
.label.is-2 .label-track { transform: translateX(-50%); }
.label-pane { width: 50%; padding: 12px 16px 16px; display: grid; gap: 10px; align-content: start; }

/* Print-form fields inside the label */
.label .fld > span, .label .fld legend, .label .lbl { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }
.label .ctl { min-height: 44px; padding: 8px 2px 6px; border: 0; border-bottom: 1.5px solid var(--line-control); border-radius: 0; background-color: transparent; font-size: 16px; }
.label select.ctl { background-position: right 2px center; padding-right: 28px; }
.label .ctl:hover { border-bottom-color: var(--azul); }
.label .ctl:focus { box-shadow: 0 1.5px 0 var(--azul); border-bottom-color: var(--azul); }
.label .ctl:focus-visible { outline: 2px solid var(--azul); outline-offset: 3px; border-radius: 2px; }
.label .ctl.is-invalid { border-bottom-color: var(--rojo); }
.label .seg { display: flex; flex-wrap: wrap; gap: 0 18px; padding: 0; background: none; border-radius: 0; }
.label .seg label { display: flex; align-items: center; gap: 9px; min-height: 44px; cursor: pointer; }
.label .seg input { position: static; opacity: 1; pointer-events: auto; appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 0; flex: none; border: 1.5px solid var(--line-control); border-radius: 3px; background: #fff center / 14px no-repeat; cursor: pointer; transition: background-color 140ms ease, border-color 140ms ease; }
.label .seg input:checked { border-color: var(--azul); background-color: var(--azul); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.label .seg input:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; }
.label .seg span { display: inline; min-height: 0; padding: 0; background: none !important; box-shadow: none !important; font-size: 15px; font-weight: 600; color: var(--ink) !important; }
.label .pair-row .swap { width: 32px; height: 32px; }
.qty { display: inline-flex; align-items: center; border-bottom: 1.5px solid var(--line-control); }
.qty button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: var(--azul); cursor: pointer; border-radius: 4px; }
.qty button:hover { background: var(--azul-soft); }
.qty button svg { width: 18px; height: 18px; }
.qty input { width: 48px; min-height: 44px; border: 0; background: none; text-align: center; font: 700 17px var(--font-sans); color: var(--ink); font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button, .qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty-row { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.label .back-link { justify-self: start; }
.label-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-muted); }
.label-note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--azul); }

/* Dispatched state */
.sent { display: none; padding: 16px 16px 18px; }
.label.is-sent .label-steps, .label.is-sent .label-track { display: none; }
.label.is-sent .sent { display: grid; gap: 10px; }
.sent h2 { margin: 0; font-size: 21px; font-weight: 900; letter-spacing: -.01em; color: var(--azul); }
.sent p { margin: 0; font-size: 15px; color: var(--ink-muted); }
.sent .btn { justify-self: start; margin-top: 4px; }
.sent:focus { outline: none; }
.envelope.is-sent { animation: dispatch 900ms var(--ease-out); }
.envelope.is-sent .postmark { animation: postmark 420ms 640ms var(--ease-out) forwards; }
@keyframes dispatch { 0% { transform: rotate(1.6deg); } 35% { transform: translate(14px, -16px) rotate(4deg); } 100% { transform: rotate(1.6deg); } }
@keyframes postmark { 0% { opacity: 0; transform: scale(1.5) rotate(-4deg); filter: blur(4px); } 60% { opacity: .9; transform: scale(.96) rotate(-9deg); filter: blur(0); } 100% { opacity: .85; transform: scale(1) rotate(-8deg); } }

/* ---------- Apostille explainer ---------- */
.apost { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.stack3 { position: relative; height: 380px; max-width: 520px; }
.stack3 .pg { position: absolute; width: 46%; height: 300px; padding: 22px 22px; background: var(--paper); border-radius: 4px; box-shadow: 0 1px 0 var(--paper-edge), 0 18px 40px -22px rgba(16,23,63,.4); color: var(--ink-print); }
.stack3 .pg:nth-child(1) { left: 0; top: 40px; transform: rotate(-5deg); }
.stack3 .pg:nth-child(2) { left: 27%; top: 20px; transform: rotate(1deg); }
.stack3 .pg:nth-child(3) { left: 54%; top: 0; transform: rotate(4deg); }
.pg small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-print); }
.pg .ln { display: block; height: 7px; margin-top: 10px; border-radius: 4px; background: #e9e6ee; }
.pg .tag { position: absolute; left: 14px; bottom: 16px; max-width: calc(100% - 20px); display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: var(--azul); }
.pg .tag i { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--rojo); color: #fff; font-style: normal; font-size: 12px; }
.pg .apo { margin-top: 12px; border: 1.5px solid var(--ink-print); padding: 8px 10px; font-size: 11px; font-weight: 700; letter-spacing: .06em; line-height: 1.5; }
.pg .seal-mini { position: absolute; right: 18px; bottom: 44px; width: 64px; height: 64px; border: 2.5px solid var(--rojo); border-radius: 50%; display: grid; place-items: center; color: var(--rojo); font-size: 11px; font-weight: 800; letter-spacing: .06em; transform: rotate(-12deg); }
.apost-note { margin-top: 14px; font-size: 13px; color: var(--ink-muted); }
@media (max-width: 960px) { .apost { grid-template-columns: 1fr; } .apost > div:first-child { order: 2; } .stack3 { height: 340px; margin-inline: auto; } }

@media (max-width: 1020px) { .env-stage { padding-top: 42px; } }
@media (max-width: 560px) {
  .envelope { padding: 10px; transform: rotate(.8deg); }
  .env-body { padding: 16px 14px 16px; }
  .env-from { padding-right: 80px; }
  .postage { width: 62px; height: 76px; top: 10px; right: 10px; }
  .label-pane { padding: 12px 12px 16px; }
  .stack3 .pg { width: 48%; height: 250px; padding: 16px 12px; }
  .stack3 .pg:nth-child(2) { left: 26%; } .stack3 .pg:nth-child(3) { left: 52%; }
  .pg .tag { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .label-track, .env-flap { transition: none; }
  .label.is-sent .barcode svg, .label.is-sent .label-head .guia b { animation: none; }
  .envelope.is-sent { animation: none; }
  .envelope.is-sent .postmark { animation: none; opacity: .85; transform: rotate(-8deg); }
}
.auth--hero { margin-top: 0; }
.auth--hero li { padding: 7px 14px; font-size: 14px; }
.sent-to { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: baseline; padding: 6px 0 8px; border-bottom: 1px solid #b9b3a9; }
.sent-to span { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); }
.sent-to b { font-size: 16px; font-weight: 700; color: var(--ink-print); overflow-wrap: anywhere; }
#envio { width: min(100%, 470px); }
.envelope { width: 100%; }
.stack-legend { display: none; }
@media (max-width: 560px) {
  .pg .tag { font-size: 0; gap: 0; } .pg .tag i { font-size: 12px; }
  .stack3 { width: calc(100% - 24px); }
  .stack-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 0; font-size: 14px; font-weight: 700; color: var(--azul); }
  .stack-legend span { display: inline-flex; align-items: center; gap: 8px; }
  .stack-legend i { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--rojo); color: #fff; font-style: normal; font-size: 12px; font-weight: 800; }
}

/* ---------- Tracking timeline (how it works) ---------- */
.tracking { border: 1.5px solid var(--ink-print); border-radius: 4px; background: #fff; box-shadow: 0 1px 0 var(--paper-edge), 0 18px 40px -28px rgba(16,23,63,.35); }
.tracking-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 28px; border-bottom: 1.5px solid var(--ink-print); }
.tracking-head p { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-print); }
.tracking-head .guia { text-align: right; }
.tracking-head .guia small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--ink-muted); }
.tracking-head .guia b { display: block; font-size: 15px; font-weight: 800; color: var(--rojo); font-variant-numeric: tabular-nums; letter-spacing: .02em; text-transform: none; }
.tracking-head .guia b.is-blank { color: var(--ink-muted); letter-spacing: .08em; }
.route { list-style: none; margin: 0; padding: 32px 28px 36px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.stop { position: relative; }
.stop:not(:last-child)::before { content: ""; position: absolute; top: 8px; left: 26px; right: -32px; border-top: 2px dashed var(--line-control); }
.stop-dot { position: relative; display: block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--azul); background: #fff; }
.stop:first-child .stop-dot { background: var(--azul); box-shadow: inset 0 0 0 3px #fff; }
.stop:last-child .stop-dot { border-color: var(--rojo); background: var(--rojo); box-shadow: inset 0 0 0 3px #fff; }
.stop-st { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 0; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-print); }
.stop-st b { font-size: 15px; letter-spacing: .02em; color: var(--rojo); font-variant-numeric: tabular-nums; }
.stop h3 { margin: 10px 0 0; font-size: 21px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; color: var(--azul); }
.stop > p:last-child { margin: 8px 0 0; font-size: 16px; color: var(--ink-muted); }
@media (max-width: 860px) {
  .tracking-head { padding: 12px 16px; }
  .route { grid-template-columns: 1fr; gap: 0; padding: 24px 16px 8px; }
  .stop { padding: 0 0 26px 36px; }
  .stop-dot { position: absolute; left: 0; top: 1px; }
  .stop:not(:last-child)::before { top: 24px; bottom: 4px; left: 8px; right: auto; border-top: 0; border-left: 2px dashed var(--line-control); }
  .stop-st { margin-top: 0; }
}
.label-head .guia b, .tracking-head .guia b { white-space: nowrap; }
