/* Colectica Store: additions to the colectica.com stylesheet.

   /assets/css/site.css is a copy of the website's stylesheet
   (static/assets/css/site.css in the website repository). It is replaced as a
   whole when the website's design changes, and it is not edited here.
   This file holds the parts that only the store needs. Every color comes from
   the website's design tokens, so each part works in light and dark.

   Contents
     1. Status colors
     2. Page opening
     3. Forms and messages
     4. Sign-in and account pages
     5. Store home
     6. Order summary and receipt */

/* ---------- 1. Status colors ---------- */

/* The website has no error color of its own.
   As in site.css, the dark values are written twice and must stay identical. */
:root {
  --danger-text: #9b2c20;
  --danger-line: #dfa79d;
  --danger-bg: #fbefec;
}

@media (prefers-color-scheme: dark) {
  :root:not(.light-only):not([data-theme="light"]) {
    --danger-text: #f2aa9d;
    --danger-line: rgba(242, 170, 157, 0.45);
    --danger-bg: rgba(226, 98, 78, 0.14);
  }
}

:root[data-theme="dark"]:not(.light-only) {
  --danger-text: #f2aa9d;
  --danger-line: rgba(242, 170, 157, 0.45);
  --danger-bg: rgba(226, 98, 78, 0.14);
}

/* ---------- 2. Page opening ---------- */

/* A store page opens with the website's .page-hero, at a size that suits a
   long product name. */
.page-hero--compact {
  padding: 44px 0 36px;
}

.page-hero--compact h1 {
  max-width: 900px;
  margin-bottom: 14px;
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.page-hero--compact .lead {
  font-size: 18px;
}

/* The account button at the end of the header */
.site-nav__account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.site-nav__account .site-nav__cta {
  margin-left: 0;
}

@media (max-width: 1260px) {
  .site-nav__account {
    margin-left: 0;
  }
}

/* ---------- 3. Forms and messages ---------- */

input[readonly],
.form-control[readonly] {
  border-style: dashed;
  background: var(--bg-2);
  color: var(--body);
}

input[type="file"] {
  max-width: 100%;
  color: var(--body);
  font: inherit;
  font-size: 15px;
}

input[type="file"]::file-selector-button {
  min-height: 40px;
  margin-right: 12px;
  padding: 0 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* Messages written by the server-side validation helpers */
.field-validation-valid,
.validation-summary-valid {
  display: none;
}

.field-validation-error {
  display: block;
  margin-top: 6px;
  color: var(--danger-text);
  font-size: 14px;
}

.input-validation-error,
.form-control.input-validation-error {
  border-color: var(--danger-text);
}

.validation-summary-errors,
.message {
  margin: 0 0 20px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--card);
  color: var(--ink);
  font-size: 15.5px;
}

.validation-summary-errors,
.message--danger {
  border-color: var(--danger-line);
  border-left-color: var(--danger-text);
  background: var(--danger-bg);
}

.validation-summary-errors ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.message > :first-child {
  margin-top: 0;
}

.message > :last-child {
  margin-bottom: 0;
}

.text-danger {
  color: var(--danger-text);
}

.text-success,
.text-info {
  color: var(--accent-text);
}

/* An empty message line takes no room. */
.text-danger:empty,
.text-success:empty {
  display: none;
}

/* ---------- 4. Sign-in and account pages ---------- */

/* A narrow column that holds one form in a card */
.auth {
  max-width: 500px;
  margin: 0 auto;
}

.auth--wide {
  max-width: 660px;
}

.auth-card {
  padding: clamp(24px, 3.2vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--card);
}

.auth-card h1 {
  margin: 0 0 16px;
  font-size: clamp(28px, 3vw, 34px);
  line-height: 1.1;
}

.auth-card h2 {
  margin: 28px 0 10px;
  font-size: 19px;
}

.auth-card > form,
.auth-card > p:last-child {
  margin-bottom: 0;
}

.auth-card .lead {
  margin: 0 0 24px;
  font-size: 17px;
}

/* The fields of a form, one under another */
.field-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0 0 24px;
}

.field-stack .field-grid {
  flex: none;
}

/* A checkbox with its label on one line */
.check {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  color: var(--body);
  font-weight: 400;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
}

/* The links under a sign-in form */
.auth-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 28px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  font-size: 15.5px;
  list-style: none;
}

.auth-links li {
  margin: 0;
}

.auth-providers {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- 5. Store home ---------- */

/* The sign-in prompt, or the greeting for a signed-in visitor */
.welcome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  margin: 0 0 28px;
  padding: 22px 26px;
  border-radius: var(--radius-lg);
  background: var(--bg-2);
}

.welcome__text {
  flex: 1 1 380px;
  min-width: 0;
}

.welcome__text > * {
  margin: 0;
}

.welcome__text > * + * {
  margin-top: 6px;
}

.welcome__lead {
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
}

/* One part of the store home: a heading, then its cards */
.store-block > :first-child {
  margin-top: 0;
}

.store-block > :last-child {
  margin-bottom: 0;
}

.store-block > .card-grid {
  margin-top: 20px;
}

/* Product cards keep one width, whether a row holds one card or three. */
.offer-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
}

.stack > .welcome {
  margin-bottom: 0;
}

/* The purchase and registration links inside a product card */
.offer-list {
  align-self: stretch;
  margin: 4px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.offer-list li {
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.offer-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 0;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 600;
  text-decoration: none;
}

.offer-list a:hover {
  color: var(--accent-text);
}

.offer-list svg {
  flex: none;
}

/* ---------- 6. Order summary and receipt ---------- */

.receipt {
  padding: clamp(22px, 2.8vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--card);
}

.receipt > h2 {
  margin: 0 0 12px;
  font-size: 26px;
}

.receipt > h2:focus {
  outline: none;
}

.receipt > .table-scroll {
  margin: 24px 0;
  border-radius: var(--radius-md);
}

.receipt-table {
  min-width: 720px;
  font-size: 15.5px;
}

.receipt-table caption {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  font-weight: 600;
  text-align: left;
}

.receipt-table th,
.receipt-table td {
  padding: 14px 18px;
}

.receipt-table td > :last-child {
  margin-bottom: 0;
}

.receipt-table__total td {
  color: var(--ink);
  font-weight: 600;
}

.receipt-table .num {
  text-align: right;
  white-space: nowrap;
}

/* Activation codes are set in the mono font, and one click selects a whole code. */
.activation-codes {
  margin: 0;
  padding: 0;
  list-style: none;
}

.activation-codes li {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
  overflow-wrap: anywhere;
  user-select: all;
}

.activation-codes li + li {
  margin-top: 6px;
}
