/* InID's own colors and type, in one place. The landing, the docs and the panel
   (apps/site/site.css, apps/panel/panel.css) and the buyer's component
   (apps/element/styles.css) are built with this file in front of them and name these
   instead of repeating the values. Each keeps its own grays and its own way of going dark. */
:root {
  --inid-black: #111113;
  --inid-lime: #c6ff3d;
  /* Lime as text or a mark on a light background */
  --inid-lime-ink: #5c8a00;
  --inid-good: #1a7f37;
  --inid-good-dark: #3fb950;
  --inid-bad: #c4231a;
  --inid-bad-dark: #ff6b60;
  --inid-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
}

/* The element lives inside other people's organizations: neutral, compact, legible in light and dark */
/* --inid-primary, --inid-radius, --inid-bg…: the app's look (the panel's Apariencia), set by
   element.ts only when the app has one; InID's own values otherwise */
:root {
  --ink: var(--inid-ink, #1d1d1f); --muted: var(--inid-muted, #6e6e73); --line: var(--inid-line, #d2d2d7); --fill: var(--inid-fill, #f5f5f7); --bg: var(--inid-bg, #ffffff);
  --accent: var(--inid-primary, var(--inid-black)); --accent-ink: var(--inid-primary-ink, #ffffff); --pixel: var(--inid-lime-ink); --lime: var(--inid-lime); --btn-pixel: var(--inid-lime); --tick-ink: var(--inid-primary-ink, var(--inid-lime)); --bad: var(--inid-bad); --good: var(--inid-good);
  --radius: var(--inid-radius, 12px); color-scheme: light;
  font: 15px/1.4 var(--inid-font);
}
/* Dark only when the organization asks for it (or for "auto" and the buyer's OS is dark) */
:root[data-theme="dark"] { --ink: #f5f5f7; --muted: #a1a1a6; --line: #3a3a3c; --fill: #1c1c1e; --bg: var(--inid-black); --accent: var(--inid-primary, var(--inid-lime)); --accent-ink: var(--inid-primary-ink, var(--inid-black)); --pixel: var(--inid-lime); --btn-pixel: rgba(17,17,19,.45); --tick-ink: var(--inid-primary-ink, var(--inid-black)); --bad: var(--inid-bad-dark); --good: var(--inid-good-dark); color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] { --ink: #f5f5f7; --muted: #a1a1a6; --line: #3a3a3c; --fill: #1c1c1e; --bg: var(--inid-black); --accent: var(--inid-primary, var(--inid-lime)); --accent-ink: var(--inid-primary-ink, var(--inid-black)); --pixel: var(--inid-lime); --btn-pixel: rgba(17,17,19,.45); --tick-ink: var(--inid-primary-ink, var(--inid-black)); --bad: var(--inid-bad-dark); --good: var(--inid-good-dark); color-scheme: dark; }
}
/* The app's own mark on top, InID small at the end */
.app-mark { display: inline-flex; align-items: center; min-height: 22px; }
.app-mark img { display: block; max-height: 28px; max-width: 160px; width: auto; height: auto; }
.app-mark b { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.with-inid { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-size: 11.5px; color: var(--muted); }
.with-inid .logo .icon { width: 12px; height: 12px; }
.with-inid .logo .word { display: none; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
main { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.title { font-size: 16px; font-weight: 650; line-height: 1.25; margin: 0; letter-spacing: -.01em; }
.lead { margin: -4px 0 0; color: var(--muted); }
.hint, .small { font-size: 12.5px; color: var(--muted); margin: 0; }
.muted { color: var(--muted); }
form { display: flex; gap: 10px; margin: 0; }
form.stack { flex-direction: column; }
form.busy { pointer-events: none; }
form.busy input, form.busy select, form.busy label, form.busy button:not(.loading) { opacity: .6; }
.row { align-items: flex-end; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2.doc { grid-template-columns: 1fr 1.4fr; }
.grow { flex: 1; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); min-width: 0; }
input, select {
  font: inherit; font-size: 16px; /* 16px stops iOS from zooming on focus */
  height: 44px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 100%;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: right 15px center, right 10px center; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
input:focus, select:focus { outline: 3px solid color-mix(in srgb, var(--accent) 30%, transparent); border-color: var(--accent); }
input.code { letter-spacing: .4em; font-variant-numeric: tabular-nums; }
button {
  font: inherit; font-weight: 600; height: 44px; padding: 0 18px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--fill); color: var(--ink); cursor: pointer; white-space: nowrap;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.ghost { background: transparent; }
button.wide { width: 100%; }
button.link { background: none; border: 0; padding: 0; height: auto; color: var(--accent); font-weight: 500; align-self: flex-start; text-decoration: underline; text-underline-offset: 3px; white-space: normal; text-align: left; line-height: 1.4; }
button:disabled { opacity: .6; cursor: default; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.error { color: var(--bad); font-size: 13px; margin: 0; flex-basis: 100%; }
.shared { margin: 0; padding: 8px 12px; list-style: none; background: var(--fill); border-radius: var(--radius); display: grid; gap: 4px; font-size: 13.5px; }
.shared li { display: flex; justify-content: space-between; gap: 12px; }
.shared li > span:first-child::before { content: "✓"; color: var(--good); font-weight: 700; margin-right: 8px; }
.shared li > .muted { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
a { color: var(--accent); }
.done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 8px 0; }
.tick { width: 44px; height: 44px; border-radius: 11px; background: var(--accent); position: relative; animation: tick-in .35s cubic-bezier(.2,.9,.3,1.3) both; }
/* The mark's check: drawn with borders, then the lime pixel lands on it */
.tick::before { content: ""; position: absolute; left: 13px; top: 19px; width: 14px; height: 7px; border: solid var(--tick-ink); border-width: 0 0 4px 4px; transform: rotate(-45deg); transform-origin: left top; animation: tick-draw .3s .15s ease-out both; }
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: -2px; }
.logo { color: var(--muted); display: inline-flex; align-items: center; gap: 5px; opacity: .85; }
.logo svg { display: block; }
.logo .icon { width: 16px; height: 16px; }
.logo .word { height: 11px; width: auto; fill: currentColor; }
.logo .word .stroke { fill: none; stroke: currentColor; }
.logo .px { fill: var(--pixel); }
.x { height: 26px; width: 26px; padding: 0; border: 0; border-radius: 50%; background: var(--fill); color: var(--muted); font-size: 17px; line-height: 1; }
.done.compact { flex-direction: row; justify-content: center; padding: 2px 0; }
.done.compact .tick { width: 26px; height: 26px; border-radius: 7px; }
.done.compact .tick::before { left: 7px; top: 11px; width: 9px; height: 4px; border-width: 0 0 3px 3px; }
.lead { font-size: 13.5px; }
/* In an organization's page the frame is the card: rounded, no outer padding of its own */
html, body { border-radius: 14px; }
@media (max-width: 420px) { .row2, .row2.doc { grid-template-columns: 1fr; } .row { flex-wrap: wrap; } .row > button { width: 100%; } }

/* Full page (post-purchase invitation): a centered card instead of a frame */
body.page, body.activate, body.account { min-height: 100vh; background: var(--fill); display: grid; place-items: start center; padding: 6vh 16px; }
body.page main, body.activate main, body.account main { width: 100%; max-width: 440px; background: var(--bg); border-radius: 18px; padding: 24px 22px 14px; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 30px rgba(0,0,0,.06); }
details.other summary { cursor: pointer; color: var(--accent); font-size: 13px; }
details.other form { margin-top: 10px; }

/* Mi InID */
.section { font-weight: 650; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 0 -2px; }
.organizations { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.organizations li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; background: var(--fill); border-radius: var(--radius); font-size: 14px; }
button.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.notice { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good); border-radius: var(--radius); padding: 8px 12px; margin: 0; font-size: 13.5px; }
input:disabled { background: var(--fill); color: var(--muted); }

/* Loading: the mark's two pixels turn around each other in quarter steps, both moving,
   each one pulsing as it lands */
.boot { display: grid; place-items: center; padding: 28px 0; }
.pixels { position: relative; display: inline-block; width: 24px; height: 24px; animation: orbit 1.6s infinite; }
.pixels::before, .pixels::after { content: ""; position: absolute; width: 10px; height: 10px; border-radius: 2px; animation: land .4s infinite alternate ease-in-out; }
.pixels::before { left: 1px; bottom: 1px; background: var(--ink); }
.pixels::after { right: 1px; top: 1px; background: var(--pixel); animation-delay: -.4s; }
@keyframes orbit {
  0% { transform: rotate(0); animation-timing-function: cubic-bezier(.6,0,.3,1); }
  25% { transform: rotate(90deg); animation-timing-function: cubic-bezier(.6,0,.3,1); }
  50% { transform: rotate(180deg); animation-timing-function: cubic-bezier(.6,0,.3,1); }
  75% { transform: rotate(270deg); animation-timing-function: cubic-bezier(.6,0,.3,1); }
  100% { transform: rotate(360deg); }
}
@keyframes land { from { transform: scale(1); } to { transform: scale(.7); } }
/* In a button: one pixel plus its shadow as the second, turned around their midpoint */
button.loading { position: relative; color: transparent !important; opacity: 1; }
button.loading::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: 1px 0 0 -9px; border-radius: 2px;
  background: var(--accent-ink); box-shadow: 10px -10px 0 var(--btn-pixel); transform-origin: 9px -1px; animation: orbit 1.6s infinite;
}
button.loading:not(.primary) { --btn-pixel: var(--pixel); }
button.loading:not(.primary)::after { background: var(--ink); }
@keyframes tick-in { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tick-draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) { .pixels, .pixels::before, .pixels::after, button.loading::after, .tick, .tick::before { animation: none; } }

/* Several addresses: picking one for this order, and managing them in Mi InID */
.places { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
.places legend { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: 6px; }
.place { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.place:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.place input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.place > span, .place-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 14px; }
.place .muted { font-size: 13px; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 6px; background: var(--fill); color: var(--muted); vertical-align: 1px; }
.badge.on { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.places-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.places-list > li { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.places-list .actions { display: flex; gap: 16px; flex-wrap: wrap; }
.places-list .actions button.link { font-size: 13px; }
button.link.danger { color: var(--bad); }
button.link.skip { align-self: center; color: var(--muted); font-size: 13px; }
.address-form { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.places-list > li .address-form { border: 0; padding: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.chip { height: 32px; padding: 0 12px; border-radius: 16px; font-size: 13px; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* The organization's own offer, for a buyer who came back (the organization writes it) */
.offer { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: var(--radius); background: color-mix(in srgb, var(--pixel) 12%, var(--bg)); border: 1px solid color-mix(in srgb, var(--pixel) 35%, var(--line)); }
.offer-from { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.offer b { font-size: 15px; }
.offer-code { font-size: 13px; color: var(--muted); }
.offer-code code { font: 600 13px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); background: var(--bg); border: 1px dashed var(--line); border-radius: 6px; padding: 1px 6px; }

/* "Avísame": a quiet second choice under the greeting */
button.watch { display: flex; align-items: center; gap: 7px; width: 100%; margin-top: 12px; padding: 10px 0 0; height: auto; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; text-align: left; }
button.watch:hover { color: var(--ink); }
button.watch .bell { flex: none; }
.verified { display: flex; align-items: center; gap: 5px; margin: 2px 0 4px; font-size: 12.5px; color: var(--muted); }
.verified svg { width: 14px; height: 14px; flex: none; color: var(--good, var(--inid-good)); }
.title .bell { vertical-align: -2px; margin-right: 2px; }
.nowrap { white-space: nowrap; }
/* The secondary ways out of "Cambiar": quieter than its main button */
.links { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.links a { color: var(--accent); font-weight: 500; text-underline-offset: 3px; }
.links button.link { font-size: 13px; color: var(--muted); }

/* Mi InID: a subscription's actions, side by side */
.row-actions { display: inline-flex; align-items: center; gap: 10px; flex: none; }

/* Mi InID signed in: the person, then the sections. A row of tabs on a phone or in an app's
   frame; on a wide page the menu goes to the side and the page widens. */
body.account main.signed { max-width: 960px; }
.me-head { display: flex; align-items: center; gap: 12px; }
.me-head > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.me-head b { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 11px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 650; font-size: 15px; letter-spacing: .02em; }
.me-nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.me-nav::-webkit-scrollbar { display: none; }
.me-nav a { flex: none; padding: 10px 10px 9px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.me-nav a:hover { color: var(--ink); }
.me-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.me-body, .me-body > section { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.me-body > section[hidden] { display: none; }
.me-body > section > .section:first-child { margin-top: 4px; }
/* An app's sessions, under what it receives */
.app-sessions { display: grid; gap: 4px; margin-top: 8px; }
.app-sessions > span { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.app-sessions button.link { font-size: 13px; flex: none; }
.organizations li:has(.app-sessions) { align-items: flex-start; }
/* Narrow (a phone, an app's frame): the sessions get the whole width, "Quitar acceso" under them */
@media (max-width: 520px) { .organizations li:has(.app-sessions) { flex-wrap: wrap; } .organizations li:has(.app-sessions) > .grow { flex-basis: 100%; } }
@media (min-width: 760px) {
  .me { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 36px; align-items: start; margin-top: 6px; }
  .me-nav { flex-direction: column; border: 0; position: sticky; top: 16px; }
  .me-nav a { padding: 8px 12px; border: 0; margin: 0; border-radius: 10px; }
  .me-nav a[aria-current="page"] { background: var(--fill); }
  .me-body { max-width: 600px; }
}
/* Inside an app's page or InID's panel: the frame is the page */
body.account.framed { min-height: 0; padding: 0; display: block; background: var(--bg); }
body.account.framed main { max-width: none; border-radius: 0; box-shadow: none; padding: 4px 4px 8px; }
