/* ==========================================================================
   e-invoices.it
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* brand (from the logo) */
  --mint: #a1dab4;
  --teal: #41b6c4;
  --navy: #253494;
  --navy-hover: #1c2878;
  --teal-text: #1a7f8c;   /* teal for text, 4.4:1 on --bg */

  /* surfaces */
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-sunken: #f8fafc;
  --border: #e4e8f0;
  --border-strong: #cfd6e4;
  --border-input: #848da3;  /* 3.2:1 on the field, 3.1:1 on --bg */

  /* text */
  --text: #111633;
  --text-muted: #555c75;
  --text-subtle: #646b82;

  /* tinted fills */
  --mint-soft: #e9f6ed;
  --teal-soft: #e3f4f6;
  --navy-soft: #e8eaf6;

  /* a gap, then a ring of 4.4:1 on --bg: visible next to any fill (WCAG 1.4.11) */
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--teal-text);
  --shadow-card: 0 1px 2px rgba(17, 22, 51, .04), 0 8px 24px -4px rgba(17, 22, 51, .08), 0 24px 48px -12px rgba(37, 52, 148, .10);
  --shadow-raise: 0 1px 2px rgba(17, 22, 51, .06), 0 6px 16px -4px rgba(37, 52, 148, .18);

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;

  /* one content width for header, footer and every page */
  --content-width: 1240px;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at 8% -10%, rgba(161, 218, 180, .35), transparent 60%),
    radial-gradient(800px 520px at 100% 0%, rgba(65, 182, 196, .18), transparent 60%);
  background-repeat: no-repeat;
  overflow-x: hidden;
}

h1, h3, p, figure, ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg {
  display: block;
}

img {
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.hidden {
  display: none !important;
}

.nowrap {
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 20px 16px;
}

.brand {
  display: flex;
  align-items: center;
  flex: none;
  gap: 10px;
  color: var(--text);
  border-radius: var(--radius-sm);
}

.brand-icon {
  width: 34px;
  height: 34px;
}

.wordmark {
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.wordmark-tld {
  font-weight: 300;
  color: var(--text-subtle);
}

/* the hyphen: three arrows in the brand colors, drawn at hyphen height */
.wordmark-hyphen {
  display: inline-block;
  width: .6em;
  height: 1em;
  margin: 0 .01em 0 .02em;
  vertical-align: -.02em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  /* wraps below the brand when the header gets too narrow, and onto a second
     line rather than scrolling sideways */
  margin-left: auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}

.nav-link:hover {
  color: var(--text);
  background-color: rgba(17, 22, 51, .05);
}

.logout .icon {
  width: 18px;
  height: 18px;
}

/* the language menu (templates/_language.html): the current language as button,
   the languages in a list below it, right-aligned so it stays on the screen */
.lang-menu {
  position: relative;
}

.lang-menu summary {
  gap: 6px;
  cursor: pointer;
  list-style: none;
}

.lang-menu summary::-webkit-details-marker {
  display: none;
}

.lang-menu[open] summary {
  color: var(--text);
  background-color: rgba(17, 22, 51, .05);
}

.lang-menu-chevron {
  width: 16px;
  height: 16px;
}

.lang-menu[open] .lang-menu-chevron {
  transform: rotate(180deg);
}

.lang-menu-list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 168px;
  padding: 6px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-raise);
}

.lang-menu-list button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px 0 10px;
  font-size: .875rem;
  text-align: left;
  color: var(--text-muted);
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.lang-menu-list button:hover {
  color: var(--text);
  background-color: rgba(17, 22, 51, .05);
}

.lang-menu-list .icon {
  width: 18px;
  height: 18px;
  visibility: hidden;
}

/* the current language: check mark and weight, not only a color */
.lang-menu-list button[aria-current] {
  color: var(--text);
  font-weight: 600;
}

.lang-menu-list button[aria-current] .icon {
  visibility: visible;
  color: var(--teal-text);
}

@media (hover: none) and (pointer: coarse) {
  .lang-menu-list button {
    min-height: 44px;
  }
}

@media print {
  .lang-menu {
    display: none;
  }
}

/* on phones the nav links move closer */
@media (max-width: 479px) {
  .site-nav {
    gap: 0;
  }

  .nav-link {
    padding: 0 8px;
  }
}

/* on narrow phones the logout button shows only its icon, the language menu no chevron */
@media (max-width: 419px) {
  .nav-link {
    padding: 0 6px;
  }

  .lang-menu-chevron {
    display: none;
  }

  .logout span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

/* --------------------------------------------------------------------------
   Main layout
   -------------------------------------------------------------------------- */

.main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 8px 16px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "intro"
    "upload"
    "art"
    "faq";
  gap: 28px;
}

.intro {
  grid-area: intro;
}

.headline {
  font-size: clamp(2rem, 1.35rem + 2.6vw, 3.25rem);
  line-height: 1.08;
  font-weight: 750;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.headline-accent {
  background-image: linear-gradient(95deg, var(--teal-text) 0%, var(--navy) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--navy);
}

.lede {
  margin-top: 18px;
  max-width: 34rem;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text-muted);
  text-wrap: pretty;
}

/* trust row under the lede */
.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 20px;
  padding: 0;
  list-style: none;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
}

.trust li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trust .icon {
  width: 18px;
  height: 18px;
  color: var(--teal-text);
}

.art {
  grid-area: art;
  max-width: 440px;
  justify-self: center;
}

/* what goes in and what comes out: raw XML on the left, previews of the
   results on the right; every result opens the demo with sample invoices */
.demo {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  margin: 0;
}

.demo-flow + .demo-flow {
  padding-top: 16px;
  border-top: 1px dashed var(--border-strong);
}

.demo-title {
  margin-bottom: 10px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.demo-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.demo-input {
  flex: none;
  width: 138px;
}

.demo-code {
  display: flex;
  flex-direction: column;
  padding: 9px 10px;
  font: 500 .5625rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #9aa3bd;
  white-space: nowrap;
  overflow: hidden;
  background-color: var(--text);
  border-radius: 8px;
  box-shadow: 0 8px 20px -8px rgba(17, 22, 51, .45);
}

.demo-code .tag {
  color: var(--mint);
}

.demo-code .val {
  padding-left: 1.6em;
  font-weight: 700;
  color: #fff;
}

.demo-stack {
  position: relative;
  height: 62px;
  margin-top: 12px;
}

.demo-stack .layer,
.demo-code--mini {
  position: absolute;
  top: 0;
  left: 0;
  width: 126px;
  height: 46px;
  border-radius: 8px;
}

.demo-stack .layer {
  background-color: #2a3157;
  transform: translate(12px, -12px);
  opacity: .45;
}

.demo-stack .layer + .layer {
  transform: translate(6px, -6px);
  opacity: .7;
}

.demo-zip {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.demo-zip .icon {
  width: 18px;
  height: 18px;
  color: var(--teal-text);
}

.demo-arrow {
  flex: none;
  width: 36px;
  height: 13px;
}

.demo-results {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-width: 0;
}

.demo-result {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 0;
  font: inherit;
  text-align: left;
  color: var(--text);
  background: none;
  border: 0;
  cursor: pointer;
}

/* one invoice: the invoice and its attachment in one result */
.demo-result--wide {
  grid-column: 1 / -1;
}

.demo-previews {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
}

.demo-plus {
  font-size: 1rem;
  font-weight: 700;
  color: var(--teal-text);
}

.demo-card .demo-result--wide .demo-previews {
  gap: 10px;
}

.demo-preview {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(17, 22, 51, .06), 0 6px 16px -6px rgba(37, 52, 148, .25);
  transition: transform .15s ease, box-shadow .15s ease;
}

.demo-result:hover .demo-preview,
.demo-result:focus-visible .demo-preview {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(17, 22, 51, .08), 0 12px 24px -8px rgba(37, 52, 148, .35);
}

.demo-result:focus-visible {
  outline: none;
}

.demo-result:focus-visible .demo-preview {
  box-shadow: var(--focus);
}

.demo-name {
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.3;
}

.demo-cta {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: -4px;
  font-size: .75rem;
  font-weight: 700;
  color: var(--teal-text);
}

.demo-cta .icon {
  width: 14px;
  height: 14px;
  transition: transform .15s ease;
}

.demo-result:hover .demo-cta .icon {
  transform: translateX(2px);
}

.demo-hint {
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* two columns on smaller laptops: less room for the code */
@media (min-width: 960px) and (max-width: 1199px) {
  .demo-input {
    width: 118px;
  }

  .demo-code {
    font-size: .5rem;
  }

  .demo-stack .layer,
  .demo-code--mini {
    width: 108px;
  }

  .demo-arrow {
    width: 28px;
  }
}

/* narrow screens: the input above, the results below */
@media (max-width: 479px) {
  .demo-row {
    flex-wrap: wrap;
  }

  .demo-input {
    width: auto;
    flex: 1 1 100%;
  }

  .demo-row .demo-code:not(.demo-code--mini) {
    display: block;
    max-width: 210px;
  }

  .demo-row .demo-code:not(.demo-code--mini) span {
    display: block;
  }

  /* rotated, the arrow needs room above and below */
  .demo-arrow,
  .demo-card .demo-arrow {
    transform: rotate(90deg);
    margin: 14px auto 16px 40px;
  }

  .demo-results {
    flex: 1 1 100%;
  }
}

/* --------------------------------------------------------------------------
   Upload card
   -------------------------------------------------------------------------- */

.upload-card {
  grid-area: upload;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 12px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: box-shadow .2s ease, border-color .2s ease;
}

.upload-card.is-dragging {
  border-color: var(--teal);
  box-shadow: var(--shadow-card), 0 0 0 4px rgba(65, 182, 196, .18);
}

.dropzone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 300px;
  padding: 40px 20px;
  background-color: var(--surface-sunken);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}

.dropzone:hover,
.is-dragging .dropzone {
  border-color: var(--teal);
  background-color: var(--teal-soft);
}

.dropzone-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  border-radius: 20px;
  color: var(--navy);
  background: linear-gradient(140deg, var(--mint-soft), var(--teal-soft));
  border: 1px solid rgba(65, 182, 196, .25);
  transition: transform .2s ease;
}

.dropzone-icon .icon {
  width: 30px;
  height: 30px;
  stroke-width: 1.6;
}

.dropzone:hover .dropzone-icon,
.is-dragging .dropzone-icon {
  transform: translateY(-3px);
}

.dropzone-title {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.dropzone-hint {
  margin-top: 6px;
  text-wrap: balance;
  font-size: .9375rem;
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.btn-primary {
  margin-top: 28px;
  color: #fff;
  background-color: var(--navy);
  box-shadow: var(--shadow-raise);
}

.btn-primary:hover {
  background-color: var(--navy-hover);
}

.btn-primary:active {
  transform: translateY(1px);
}

/* ~, not +: for anonymous users the limit notice is between the two */
#file-upload:focus-visible ~ .dropzone .btn-primary {
  box-shadow: var(--focus);
}


/* drag and drop only where there is a mouse */
.touch-only {
  display: none;
}

@media (hover: none) and (pointer: coarse) {
  .pointer-only {
    display: none;
  }

  .touch-only {
    display: inline;
  }
}

/* --------------------------------------------------------------------------
   File list
   -------------------------------------------------------------------------- */

.file-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

/* without JavaScript the dropzone and the actions are shown together: the
   actions take their full height instead of running into the note below */
.no-js .file-panel {
  flex: none;
}

.file-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
  background-color: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* without JavaScript nobody fills it */
.file-list:empty {
  display: none;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px 10px 12px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.file-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  color: var(--navy);
  background-color: var(--navy-soft);
}

.file-name {
  flex: 1;
  min-width: 0;
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.file-size {
  flex: none;
  font-size: .8125rem;
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-subtle);
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}

.icon-btn:hover {
  color: var(--text);
  background-color: rgba(17, 22, 51, .06);
}

/* --------------------------------------------------------------------------
   Actions
   -------------------------------------------------------------------------- */

.actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-align: left;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.action:hover {
  border-color: var(--navy);
  box-shadow: var(--shadow-raise);
  transform: translateY(-1px);
}

.action:active {
  transform: translateY(0);
}

.action-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
}

.action-icon .icon {
  width: 22px;
  height: 22px;
}

.action-icon--mint {
  color: #1f7a45;
  background-color: var(--mint-soft);
}

.action-icon--teal {
  color: #1f7c88;
  background-color: var(--teal-soft);
}

.action-icon--navy {
  color: var(--navy);
  background-color: var(--navy-soft);
}

.action-icon--brand {
  color: var(--navy);
  background: linear-gradient(140deg, var(--mint-soft), var(--teal-soft));
}

.action-label {
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.action-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.action-hint {
  font-size: .8125rem;
  color: var(--text-muted);
}

.action:disabled {
  cursor: progress;
  opacity: .55;
  transform: none;
  box-shadow: none;
}

/* one invoice selected: the attachments come with its page */
.single-only,
.is-single .multi-only,
.is-single .action[value="ATTACHMENTS"] {
  display: none;
}

.is-single .single-only {
  display: inline;
}

.panel-note {
  padding: 0 4px;
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.xlsx-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.xlsx-option input {
  margin-top: 3px;
  accent-color: var(--navy);
}

.busy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 4px 12px 8px;
  font-size: .875rem;
  color: var(--text);
}

.busy-note[hidden] {
  display: none;
}

.spinner {
  width: 16px;
  height: 16px;
  flex: none;
  border: 2px solid var(--teal-soft);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 32px 16px 24px;
  font-size: .875rem;
  line-height: 1.6;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* the about text above the link columns (two on phones, three on tablets), beside them on desktops */
.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 24px;
}

.footer-about {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  max-width: 22rem;
}

.footer-about .brand {
  color: var(--text);
}

.footer-title {
  margin-bottom: 10px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.footer-col ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  color: var(--text-muted);
  text-underline-offset: 3px;
}

.site-footer a:hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-col a {
  display: inline-block;
  padding: 2px 0;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 28px;
  padding-top: 16px;
  font-size: .75rem;
  color: var(--text-subtle);
  border-top: 1px solid var(--border);
}

.footer-bottom p {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
}

.footer-version {
  font-variant-numeric: tabular-nums;
}

/* IT / DE / EN: plain buttons that look like the footer links, no flags */
.lang-switch {
  display: flex;
  gap: 4px;
}

.lang-switch button {
  padding: 2px 6px;
  font: inherit;
  color: inherit;
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
}

.lang-switch button:hover {
  color: var(--text);
  border-color: var(--border);
}

.lang-switch button[aria-current] {
  color: var(--text);
  font-weight: 600;
  border-color: var(--border);
}

/* an email address written reversed in the page (templates/_legal.html), shown the right way round */
.mail-rev {
  unicode-bidi: bidi-override;
  direction: rtl;
}

@media (min-width: 640px) {
  .site-footer {
    padding: 40px 32px 28px;
  }

  .footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px 32px;
  }
}

@media (min-width: 1000px) {
  .footer-grid {
    grid-template-columns: 1.4fr repeat(3, 1fr);
  }

  .footer-about {
    grid-column: auto;
  }
}

/* --------------------------------------------------------------------------
   Snackbar
   -------------------------------------------------------------------------- */

#snackbar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 14px 18px 14px 14px;
  font-size: .9375rem;
  line-height: 1.45;
  color: #fff;
  background-color: #151a33;
  border-radius: 14px;
  box-shadow: 0 12px 32px -8px rgba(17, 22, 51, .45);
  visibility: hidden;
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s;
}

#snackbar .icon {
  margin-top: 1px;
  color: #f7a8a8;
}

#snackbar .icon-btn {
  width: 28px;
  height: 28px;
  margin: -3px -8px -3px 4px;
  color: #c9cde0;
}

#snackbar .icon-btn:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, .12);
}

#snackbar.show {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
  transition: opacity .3s ease, transform .3s ease, visibility 0s;
}

.brand--small .brand-icon {
  width: 36px;
  height: 36px;
}

.brand--small .wordmark {
  font-size: 1.4rem;
}

.eyebrow {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-subtle);
}


/* --------------------------------------------------------------------------
   Account pages (login, account)
   -------------------------------------------------------------------------- */

.page {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 8px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* forms stay narrow inside the full-width page */
.page-card {
  align-self: center;
  width: 100%;
  max-width: 576px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 20px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  min-width: 0;
}

.page-title {
  font-size: 1.75rem;
  line-height: 1.15;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.section-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page-lede {
  color: var(--text-muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: .875rem;
  font-weight: 600;
}

.input {
  min-height: 48px;
  width: 100%;
  min-width: 0;
  padding: 0 14px;
  font: inherit;
  color: var(--text);
  background-color: var(--surface-sunken);
  border: 1px solid var(--border-input);
  border-radius: 12px;
}

.input:focus-visible {
  border-color: var(--teal);
}

.btn-solid {
  color: #fff;
  background-color: var(--navy);
  box-shadow: var(--shadow-raise);
}

.btn-solid:hover {
  background-color: var(--navy-hover);
}

.btn-ghost {
  min-height: 40px;
  padding: 0 14px;
  font-size: .875rem;
  color: var(--text-muted);
  background-color: transparent;
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.site-nav .nav-link {
  white-space: nowrap;
}

.account-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: 220px;
  padding: 0 8px;
  line-height: 1.25;
  text-align: right;
}

.account-email {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
}

.account-usage {
  font-size: .75rem;
  color: var(--text-subtle);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* on narrow phones only the email remains, shortened */
@media (max-width: 419px) {
  .account-info {
    max-width: 120px;
  }

  .account-usage {
    display: none;
  }
}

.nav-button {
  border: 0;
  background: none;
  cursor: pointer;
}

.text-link {
  font-weight: 600;
  color: var(--navy);
}

.text-link:hover {
  text-decoration: underline;
}

.alert {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  font-size: .9375rem;
  color: #8a1c1c;
  background-color: #fdecec;
  border-radius: var(--radius-sm);
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-form .input {
  flex: 1 1 220px;
}

/* --------------------------------------------------------------------------
   Info page (/come-funziona)
   -------------------------------------------------------------------------- */

.page--wide {
  gap: 40px;
}

.info-hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 720px;
  padding-top: 8px;
}

.info-hero .page-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.info-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-section .section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  font-size: .875rem;
  color: #fff;
  background-color: var(--navy);
  border-radius: 50%;
}

.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.info-card,
.demo-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.info-card h3,
.demo-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.info-card p,
.demo-card p {
  margin: 0;
  font-size: .9375rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.info-note {
  font-size: .875rem;
  color: var(--text-muted);
}

/* what goes in: the XML, a stack of files, the ZIP of the download massivo */
.info-visual {
  display: flex;
  align-items: flex-start;
  min-height: 150px;
  margin-bottom: 6px;
}

.info-visual .demo-code {
  font-size: .6875rem;
}

.info-visual .demo-stack {
  width: 172px;
  height: 74px;
  margin-top: 12px;
}

.info-visual .demo-stack .layer,
.info-visual .demo-code--mini {
  width: 160px;
  height: 54px;
}

/* one card per row on phones: no need to line the visuals up */
@media (max-width: 719px) {
  .info-visual {
    min-height: 0;
  }
}

.demo-zip-listing .zip-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
  font-weight: 700;
  color: #fff;
}

.demo-zip-listing .zip-name .icon {
  width: 14px;
  height: 14px;
  color: var(--teal);
}

.demo-zip-listing .meta {
  color: var(--mint);
}

/* what you get: each card shows the preview of its result */
/* the visuals line up, so do the titles below them */
@media (min-width: 960px) {
  .info-grid--previews .card-visual {
    display: flex;
    align-items: center;
    height: 176px;
  }
}

.info-grid--previews .demo-previews {
  max-width: 320px;
  margin-bottom: 6px;
}

.info-grid--previews .demo-previews .demo-preview {
  margin-bottom: 0;
}

.info-grid--previews .demo-preview {
  max-width: 240px;
  margin-bottom: 6px;
}

/* the demos: one card per sample, the same input, arrows and previews as the landing page */
.demo-cards {
  display: grid;
  gap: 16px;
}

.demo-card {
  gap: 18px;
  padding: 22px 24px;
}

.demo-head h3 {
  margin-bottom: 4px;
}

.demo-card .demo-results {
  flex: 0 1 auto;
  grid-template-columns: repeat(2, minmax(0, 200px));
  gap: 16px;
}

.demo-card .demo-results--3 {
  grid-template-columns: repeat(3, minmax(0, 200px));
}

.demo-card .demo-arrow {
  width: 44px;
  height: 16px;
  margin: 0 8px;
}

.demo-card .demo-input {
  width: 172px;
}

.demo-card .demo-code {
  font-size: .6875rem;
}

.demo-card .demo-stack {
  height: 74px;
}

.demo-card .demo-stack .layer,
.demo-card .demo-code--mini {
  width: 160px;
  height: 54px;
}

@media (max-width: 599px) {
  .demo-card .demo-results,
  .demo-card .demo-results--3 {
    flex: 1 1 100%;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 479px) {
  .demo-card .demo-arrow {
    margin: 14px auto 16px 40px;
  }
}

.demo-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  font-size: .875rem;
  font-weight: 600;
  color: var(--navy);
}

.demo-download:hover {
  text-decoration: underline;
}

.demo-download .icon {
  width: 16px;
  height: 16px;
}

.info-cta {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding: 24px;
  background: linear-gradient(140deg, var(--mint-soft), var(--teal-soft));
  border-radius: var(--radius-lg);
}

.info-cta > div {
  flex: 1 1 320px;
}

.info-cta .page-lede {
  margin-top: 6px;
}

@media (min-width: 640px) {
  .info-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .info-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .info-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .info-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.limit-notice {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  min-height: 300px;
  padding: 40px 20px;
  background-color: var(--surface-sunken);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
}

.limit-notice .dropzone-title {
  margin: 0;
}

.limit-notice .dropzone-icon {
  margin-bottom: 4px;
}

.limit-notice .dropzone-hint {
  max-width: 46ch;
  margin-top: -8px;
}

.limit-signup {
  justify-content: center;
  width: 100%;
  max-width: 420px;
}

.limit-signup .input {
  background-color: var(--surface);
}

.upload-limit {
  margin-top: -8px;
  padding: 0 12px 6px;
  text-align: center;
  font-size: .8125rem;
  line-height: 1.6;
  color: var(--text-muted);
  text-wrap: balance;
}

.upload-limit strong {
  font-weight: 600;
  color: var(--text);
}

.upload-limit a {
  font-weight: 600;
  color: var(--navy);
}

/* --------------------------------------------------------------------------
   FAQ (homepage)
   -------------------------------------------------------------------------- */

.faq {
  grid-area: faq;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 40px;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-item {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

/* plus that turns into a minus */
.faq-item summary::after {
  content: "+";
  flex: none;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 500;
  color: var(--teal-text);
}

.faq-item[open] summary::after {
  content: "\2212";
}

.faq-item summary:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: var(--radius-sm);
}

.faq-item p {
  padding: 0 18px 16px;
  color: var(--text-muted);
  line-height: 1.6;
}

.faq-more {
  font-size: .875rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Guides
   -------------------------------------------------------------------------- */

.breadcrumb {
  font-size: .8125rem;
  color: var(--text-subtle);
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--navy);
  text-decoration: underline;
}

/* long text: a readable line length, aligned to the content edge;
   screenshots and tables (.wide) may use the full width */
.prose {
  display: flex;
  flex-direction: column;
  gap: 14px;
  line-height: 1.7;
  color: var(--text-muted);
}

.prose > :not(.wide) {
  max-width: 46rem;
}

.prose h2[id] {
  scroll-margin-top: 16px;
}

.shot {
  margin: 6px 0 10px;
  max-width: 1000px;
}

.shot--narrow {
  max-width: 720px;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-raise);
}

.shot figcaption {
  margin-top: 8px;
  font-size: .8125rem;
  color: var(--text-subtle);
}

/* request files of the download massivo guide */
.massivo-form {
  max-width: 34rem;
}

.massivo-requests {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow-x: auto;
}

.req-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  line-height: 1.4;
}

.req-table caption {
  margin-bottom: 10px;
  text-align: left;
  color: var(--text-muted);
}

.req-table th,
.req-table td {
  padding: 8px 12px 8px 0;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.req-table thead th {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--text-subtle);
}

.req-table tbody th {
  font-weight: 600;
  color: var(--text);
}

.req-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
}

.req-download:hover {
  text-decoration: underline;
}

.req-download .icon {
  width: 16px;
  height: 16px;
}

.req-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.req-note {
  font-size: .8125rem;
  font-weight: 500;
  color: var(--text-subtle);
}

.prose .page-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--text);
}

.prose h2 {
  margin: 20px 0 0;
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--text);
}

.prose ol,
.prose ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.4em;
}

.prose strong {
  color: var(--text);
}

.prose ul {
  list-style: disc;
}

.prose code {
  font-size: .875rem;
}

/* legal pages: the three of them, one click apart */
.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.legal-nav-link {
  padding: 6px 14px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.legal-nav-link:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.legal-nav-link[aria-current="page"] {
  color: var(--navy);
  background-color: var(--navy-soft);
  border-color: transparent;
}

/* next to the forms that ask for an email: what it is used for (art. 13 GDPR) */
.form-note {
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--text-subtle);
}

.legal-updated {
  margin-top: -8px;
  font-size: .875rem;
  color: var(--text-subtle);
}

/* on a translated legal page: the Italian text is the binding one */
.legal-translation {
  padding: 10px 14px;
  font-size: .875rem;
  background: var(--navy-soft);
  border-radius: 8px;
}

.guide-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-list li {
  display: flex;
}

.guide-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  color: var(--text-muted);
  text-decoration: none;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color .15s, box-shadow .15s;
}

.guide-link strong {
  color: var(--navy);
}

.guide-link:hover {
  border-color: var(--teal);
  box-shadow: var(--shadow-raise);
}

@media (min-width: 720px) {
  .guide-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------------------
   Larger screens
   -------------------------------------------------------------------------- */

@media (min-width: 640px) {
  .site-header {
    padding: 24px 32px;
  }

  .brand-icon {
    width: 50px;
    height: 50px;
  }

  .wordmark {
    font-size: 1.75rem;
  }

  .nav-link {
    padding: 0 14px;
    font-size: .9375rem;
  }

  .main {
    padding: 8px 32px 32px;
  }

  .upload-card {
    padding: 16px;
  }

  .actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page {
    padding: 8px 32px 32px;
  }

  .page-card {
    padding: 32px;
  }
}

@media (min-width: 960px) {
  .main {
    align-content: center;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "intro upload"
      "art   upload"
      "faq   faq";
    column-gap: 64px;
    row-gap: 24px;
  }

  .intro {
    align-self: end;
    padding-top: 24px;
  }

  .art {
    align-self: start;
    justify-self: start;
    max-width: 460px;
    margin-left: -8px;
  }

  .upload-card {
    align-self: center;
    min-height: 500px;
  }

  .file-list {
    max-height: none;
    min-height: 0;
  }

  .file-panel {
    max-height: 560px;
  }

  .lede {
    font-size: 1.125rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
