/* The upgrades of the customer (views/upgrades/index.phtml, .upg-*, .up-*), from dev/store. Color of the outlines and
   of the best offer: the accent of the theme; tint of the cards: --tint of tiles.css */
/* Full width, as the home (.wrap: --wrap of theme.css) */
[data-page="account-upgrades"] .page-main { max-width: none; padding: 0; }
.upg { padding-block: 2.4rem 3.2rem; }
.upg-head h1 { margin: 0; font-size: clamp(2.56rem, 4.5vw, 3.52rem); line-height: 1.15; letter-spacing: -.025em; font-weight: 800; }
.upg-head p { max-width: 70.4rem; margin: .8rem 0 0; color: var(--muted); font-size: 1.6rem; line-height: 1.5; }
.upg-rule { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0 0; padding: 0; list-style: none; }
.upg-rule li { display: inline-flex; align-items: center; gap: .64rem; margin: 0; padding: .56rem 1.2rem; border: 1px solid var(--field-line); border-radius: 99px; background: var(--field); font-size: 1.36rem; }
.upg-rule .i, .upg-rule svg { width: 1.6rem; height: 1.6rem; color: var(--accent-ink); }
.upg .i { display: inline-flex; }
.upg .i svg { width: 100%; height: 100%; }
/* Demonstration (signed out): sample licenses, invitation to sign in */
.upg-demo { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem 1.6rem; margin-top: 2rem; padding: 1.28rem 1.6rem; border: 1px dashed var(--accent); border-radius: var(--r); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.upg-demo p { flex: 1 1 32rem; margin: 0; }
.upg-demo-k { padding: .24rem .88rem; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: 1.2rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.upg .upg-demo-cta, .upg .upg-demo-cta:visited { display: inline-flex; align-items: center; gap: .64rem; padding: .64rem 1.6rem; border: 1.5px solid var(--accent); border-radius: 99px; color: var(--accent-ink); font-weight: 700; text-decoration: none; }
.upg .upg-demo-cta:hover, .upg .upg-demo-cta:focus-visible { background: var(--accent); color: var(--on-accent); text-decoration: none; }
.upg-demo-cta .i { width: 1.6rem; height: 1.6rem; }
.upg-empty { margin-top: 2.4rem; padding: 2rem 2.4rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.upg-empty p { margin: 0 0 .8rem; }
.upg-empty p:last-child { margin: 0; }

/* Filter by domain: a field with suggestions (datalist), live filter on a part of the name */
.upg-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.6rem; margin-top: 2.4rem; }
.upg-search { position: relative; flex: 0 1 35.2rem; margin: 0; }
.upg-search .i { position: absolute; left: 1.2rem; top: 50%; width: 1.6rem; height: 1.6rem; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.upg-search input { box-sizing: border-box; width: 100%; height: auto; padding: .88rem 1.28rem .88rem 3.52rem; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--ink); font: inherit; font-size: 1.44rem; }
.upg-search input:focus { outline: 2px solid transparent; outline-offset: 0; border-color: var(--accent); box-shadow: var(--focus-ring); }
.upg-count { color: var(--muted); font-size: 1.36rem; }
.upg-none { margin: 0; color: var(--muted); }
.upg-list { display: grid; gap: 2rem; margin-top: 1.6rem; }

/* A domain, then its cards (one per range) */
.upg-dom { display: grid; gap: 1.44rem; }
.upg-dom > h2 { display: flex; align-items: center; gap: .72rem; margin: .64rem 0 0; font-size: 1.84rem; letter-spacing: -.01em; font-variant-ligatures: none; }
.upg-dom > h2 .i { width: 1.84rem; height: 1.84rem; color: var(--muted); }

/* The card: licenses on the left (centered vertically), « + », the two offers one under the other, their prices on the
   right */
.up-card { --tile: 12.8rem; --c: var(--accent); --card-bg: color-mix(in srgb, var(--c) calc(var(--tint) * 5%), var(--surface));
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) 28.8rem; grid-template-areas: 'mine plus solo sside' 'mine plus full fside';
  gap: 1.6rem 2rem; padding: 2rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--card-bg); }
.up-card > * { min-width: 0; }
.up-mine { grid-area: mine; align-self: center; }
.up-solo { grid-area: solo; } .up-sside { grid-area: sside; } .up-full { grid-area: full; } .up-fside { grid-area: fside; }
.up-solo > .up-group, .up-full > .up-group { height: 100%; box-sizing: border-box; }
@media (max-width: 64rem) {
  .up-card { grid-template-columns: minmax(0, 1fr) 28.8rem; grid-template-areas: 'mine mine' 'plus plus' 'solo sside' 'full fside'; }
  .up-mine { align-self: start; }
}
@media (max-width: 44rem) {
  .up-card { --tile: 11.2rem; grid-template-columns: minmax(0, 1fr); grid-template-areas: 'mine' 'plus' 'solo' 'sside' 'full' 'fside'; padding: 1.6rem; }
}

/* Groups of thumbnails */
.up-group { position: relative; display: flex; flex-direction: column; gap: .8rem; }
.up-group h3 { display: flex; align-items: center; gap: .72rem; margin: 0; color: var(--ink); font-size: 1.2rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.up-group.framed { padding: 1.76rem 1.12rem 1.12rem; border: 1px solid var(--accent); border-radius: 1.44rem; box-shadow: 0 0 0 1.5px var(--accent); }
.up-group.framed h3 { position: absolute; top: -1.2rem; left: .96rem; padding: 0 .64rem; background: var(--card-bg); color: var(--accent-ink); }
.up-group.framed.solo { border-color: transparent; box-shadow: none; }
/* « Range / Your licenses »: as wide as the thumbnails (does not widen them), on one line or more */
.up-mine.up-group h3 { contain: inline-size; display: block; color: var(--accent-ink); line-height: 1.35; }
.up-mine.up-group h3 span { display: block; }
.up-mine.up-group h3 span:last-child { margin-top: .64rem; padding-top: .64rem; border-top: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.up-mine .up-mods { grid-template-columns: repeat(var(--cols), var(--tile)); }
.up-mine .up-mod { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent); }

/* A single « + » badge between the licenses and the two offers */
.up-plus { grid-area: plus; align-self: center; justify-self: center; display: inline-flex; align-items: center; justify-content: center; width: 3.52rem; height: 3.52rem; border-radius: 99px; background: var(--accent); color: var(--on-accent); }
.up-plus svg { width: 1.92rem; height: 1.92rem; stroke-width: 3; }

/* Thumbnails of the same size: fixed columns, the name below */
.up-mods { display: grid; grid-template-columns: repeat(auto-fill, var(--tile)); grid-auto-rows: 1fr; gap: .96rem; margin: 0; padding: 0; list-style: none; }
.up-mod { position: relative; display: flex; flex-direction: column; margin: 0; border: 1px solid var(--line); border-radius: 1.12rem; background: var(--surface); overflow: hidden; }
.up-art, .up-art svg { display: block; width: 100%; aspect-ratio: 1; }
.up-mod b { display: block; flex: 1; padding: .56rem .72rem .8rem; font-size: 1.312rem; line-height: 1.25; letter-spacing: -.01em; }
.up-mod .up-price { position: absolute; top: .64rem; left: .64rem; z-index: 1; padding: .16rem .72rem; border-radius: 99px; background: var(--surface); box-shadow: 0 1px 4px rgb(0 0 0 / .15); font-size: 1.152rem; font-weight: 700; font-variant-numeric: tabular-nums; }
/* À la carte: each thumbnail can be picked; grey until picked, then with the outline of the accent */
.up-mod.pick { cursor: pointer; transition: border-color .2s, box-shadow .2s, transform .2s, filter .2s, opacity .2s; }
.up-mod.pick:hover { transform: translateY(-2px); }
.up-mod.pick[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent); }
.up-mod.pick[aria-checked="false"] { filter: grayscale(1); opacity: .5; }
.up-mod.pick[aria-checked="false"]:hover { filter: grayscale(.4); opacity: .8; }
.up-mod.pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Help on the replacement of the licenses: « i » badge, bubble on hover or focus */
.up-help { position: relative; display: inline-flex; margin-left: .24rem; padding: 0; border: 0; background: none; box-shadow: none; color: var(--accent-ink); cursor: help; text-transform: none; letter-spacing: 0; }
.up-help:hover, .up-help:focus { border: 0; background: none; color: var(--ink); box-shadow: none; }
.up-help svg { width: 1.52rem; height: 1.52rem; }
.up-help span { position: absolute; z-index: 5; bottom: calc(100% + .72rem); left: 50%; width: 24rem; padding: .8rem 1.12rem; border-radius: .8rem; background: var(--ink); color: var(--surface); font-size: 1.248rem; font-weight: 500; line-height: 1.35; text-align: left; transform: translateX(-50%); opacity: 0; visibility: hidden; transition: opacity .15s; pointer-events: none; }
.up-help:hover span, .up-help:focus span { opacity: 1; visibility: visible; }

/* Price blocks: amount, a line of explanation, button, foldable detail */
.up-side { position: relative; display: flex; flex-direction: column; justify-content: center; gap: .88rem; padding: 1.44rem 1.6rem; border: 1.5px solid var(--line); border-radius: 1.44rem; background: var(--surface); }
.up-side.best { border: 1px solid var(--accent); box-shadow: 0 0 0 1.5px var(--accent), 0 10px 26px -14px color-mix(in srgb, var(--accent) 60%, transparent); }
.up-best { position: absolute; top: -1.12rem; right: 1.28rem; padding: .192rem .88rem; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: 1.152rem; font-weight: 700; }
.up-side:not(.best) .up-best { display: none; }
.up-big { display: flex; align-items: baseline; justify-content: center; gap: .8rem; margin: 0; }
.up-big strong { color: var(--ink); font-size: 2.56rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.up-value { margin: 0; color: var(--muted); font-size: 1.36rem; text-align: center; }
.up-cta { display: inline-flex; align-items: center; justify-content: center; gap: .72rem; min-height: 4.16rem; padding: .64rem 1.92rem; border: 0; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: 1.44rem; font-weight: 700; white-space: nowrap; cursor: pointer; box-shadow: none; }
.up-cta:hover, .up-cta:focus { border: 0; background: color-mix(in srgb, var(--accent) 85%, var(--ink)); color: var(--on-accent); }
.up-side:not(.best) .up-cta { border: 1.5px solid var(--accent); background: transparent; color: var(--accent-ink); }
.up-side:not(.best) .up-cta:not(:disabled):hover { background: var(--accent); color: var(--on-accent); }
.up-cta:disabled { opacity: .45; cursor: default; }
.up-cta[aria-busy="true"] { opacity: .7; cursor: progress; }
.up-cta .i { width: 1.76rem; height: 1.76rem; }
.up-detail { color: var(--muted); font-size: 1.28rem; }
.up-detail summary { display: flex; align-items: center; justify-content: center; gap: .4rem; cursor: pointer; text-align: center; list-style: none; }
.up-detail summary::-webkit-details-marker { display: none; }
.up-detail summary svg { flex: none; width: 1.52rem; height: 1.52rem; transition: transform .2s; }
.up-detail[open] summary svg { transform: rotate(180deg); }
.up-calc { display: grid; grid-template-columns: 1fr auto; gap: .32rem 1.6rem; margin: .64rem 0 0; font-size: 1.312rem; font-variant-numeric: tabular-nums; }
.up-calc dt { margin: 0; color: var(--muted); font-weight: 400; }
.up-calc dd { margin: 0; color: var(--ink); text-align: right; }
.up-calc .gift { color: var(--accent-ink); font-weight: 600; }
.up-calc .gift s { margin-right: .56rem; color: var(--muted); font-weight: 400; }

/* Range already complete on this domain */
.up-card.done { display: block; }
.up-done { display: flex; align-items: center; gap: .96rem; margin: 0; font-weight: 600; }
.up-done .i { width: 2.24rem; height: 2.24rem; color: var(--accent-ink); }

@media (prefers-reduced-motion: reduce) {
  .up-mod.pick, .up-detail summary svg { transition: none; }
  .up-mod.pick:hover { transform: none; }
}
@media print {
  .upg-bar, .up-cta, .up-help { display: none !important; }
  .up-card { break-inside: avoid; }
}
