/* ===========================================================================
   SSL certificate ordering
   ---------------------------------------------------------------------------
   Loaded after main.css on ssl-ordering.php, ssl-configure.php and
   ssl-order.php. Replaces the ~730 lines of SSL rules that used to sit at the
   bottom of main.css.

   WHY IT LOOKS DIFFERENT
   The old page was styled in a palette the site does not use -- #4a90e2 blue,
   #00ff88 neon green and slate-grey gradients -- dropped on top of Forty's
   indigo. Everything below is built from the palette already in main.css:
   #242943 ground, #9bf1ff / #53e3fb accent, and the muted tones the theme
   already uses for status (#87c5a4, #e7b788, #ec8d81). Nothing here is a new
   colour.

   The other structural change: the product grid was pinned at exactly six
   columns and then walked back down through ten hand-written breakpoints. It
   is one auto-fitting grid now, so there are no breakpoints to keep in sync.
   =========================================================================== */

:root {
    --ssl-panel:        rgba(255, 255, 255, 0.045);
    --ssl-panel-hover:  rgba(255, 255, 255, 0.075);
    --ssl-line:         rgba(255, 255, 255, 0.13);
    --ssl-line-strong:  rgba(255, 255, 255, 0.3);
    --ssl-muted:        rgba(255, 255, 255, 0.62);
    --ssl-faint:        rgba(255, 255, 255, 0.42);
    --ssl-accent:       #9bf1ff;
    --ssl-accent-deep:  #53e3fb;
    --ssl-good:         #87c5a4;
    --ssl-warn:         #e7b788;
    --ssl-bad:          #ec8d81;
    --ssl-radius:       10px;
    --ssl-radius-lg:    14px;
}

/* --- shared primitives -------------------------------------------------- */

.ssl-page .inner {
    max-width: 1400px;
}

.ssl-lede {
    max-width: 62ch;
    color: var(--ssl-muted);
    font-size: 1.05rem;
    line-height: 1.65;
}

.ssl-panel {
    background: var(--ssl-panel);
    border: 1px solid var(--ssl-line);
    border-radius: var(--ssl-radius-lg);
    padding: 1.75rem;
}

.ssl-panel + .ssl-panel {
    margin-top: 1.5rem;
}

.ssl-panel > h2,
.ssl-panel > h3 {
    margin-top: 0;
}

/* Small uppercase label used above prices, groups and card brands. */
.ssl-eyebrow {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ssl-faint);
    margin-bottom: 0.4rem;
}

.ssl-muted { color: var(--ssl-muted); }

.ssl-mono {
    font-family: "Courier New", monospace;
    word-break: break-all;
}

/* --- trust strip -------------------------------------------------------- */

.ssl-assurances {
    list-style: none;
    padding: 0;
    margin: 2rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 2rem;
}

.ssl-assurances li {
    padding: 0;
    color: var(--ssl-muted);
    font-size: 0.92rem;
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
}

.ssl-assurances li::before {
    content: '';
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ssl-accent);
}

/* --- toolbar: search, filters, sort ------------------------------------- */

.ssl-toolbar {
    margin: 2.5rem 0 1.5rem;
    display: grid;
    gap: 1.25rem;
}

.ssl-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.ssl-search {
    flex: 1 1 260px;
    min-width: 0;
}

/* Forty styles inputs globally; these only adjust what the shop needs. */
.ssl-toolbar input[type="search"],
.ssl-toolbar select {
    margin: 0;
}

.ssl-filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.ssl-filter-group > .ssl-eyebrow {
    margin: 0 0.25rem 0 0;
}

.ssl-chip {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 1px solid var(--ssl-line-strong);
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    font-size: 0.82rem;
    line-height: 1;
    padding: 0.55rem 1rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ssl-chip:hover {
    border-color: var(--ssl-accent);
    background: var(--ssl-panel-hover);
}

.ssl-chip[aria-pressed="true"] {
    background: var(--ssl-accent);
    border-color: var(--ssl-accent);
    color: #242943;
    font-weight: 600;
}

.ssl-result-count {
    color: var(--ssl-faint);
    font-size: 0.85rem;
    margin-left: auto;
}

/* --- product grid ------------------------------------------------------- */

/* auto-fit, so the column count follows the container instead of a stack of
   media queries. minmax's floor is the narrowest a card can be and still fit
   a price and a two-line product name. */
.ssl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(264px, 1fr));
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ssl-card {
    display: flex;
    flex-direction: column;
    background: var(--ssl-panel);
    border: 1px solid var(--ssl-line);
    border-radius: var(--ssl-radius-lg);
    padding: 1.5rem;
    transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.ssl-card:hover,
.ssl-card:focus-within {
    border-color: var(--ssl-line-strong);
    background: var(--ssl-panel-hover);
    transform: translateY(-2px);
}

.ssl-card h3 {
    font-size: 1.02rem;
    line-height: 1.35;
    letter-spacing: 0.02em;
    margin: 0 0 0.85rem;
}

.ssl-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.1rem;
}

.ssl-badge {
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.28rem 0.55rem;
    border-radius: 4px;
    border: 1px solid var(--ssl-line-strong);
    color: var(--ssl-muted);
    white-space: nowrap;
}

.ssl-badge-dv { border-color: rgba(155, 241, 255, 0.5); color: var(--ssl-accent); }
.ssl-badge-ov { border-color: rgba(231, 183, 136, 0.5); color: var(--ssl-warn); }
.ssl-badge-ev { border-color: rgba(135, 197, 164, 0.6); color: var(--ssl-good); }

.ssl-price {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-bottom: 1.1rem;
}

.ssl-price strong {
    font-size: 1.9rem;
    line-height: 1;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.ssl-price span {
    color: var(--ssl-faint);
    font-size: 0.85rem;
}

.ssl-facts {
    list-style: none;
    margin: 0 0 1.4rem;
    padding: 0;
    font-size: 0.86rem;
    color: var(--ssl-muted);
}

.ssl-facts li {
    padding: 0.32rem 0;
    border-top: 1px solid var(--ssl-line);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.ssl-facts li:first-child { border-top: 0; }
.ssl-facts li span:last-child { color: #fff; text-align: right; }

.ssl-card .ssl-card-cta {
    margin-top: auto;
}

/* A product with no vendor product code cannot actually be bought, so it is
   shown greyed with an explanation rather than sold and stranded. */
.ssl-card.is-unavailable { opacity: 0.55; }

.ssl-card.is-unavailable .ssl-card-cta {
    font-size: 0.82rem;
    color: var(--ssl-faint);
    text-align: center;
    padding: 0.6rem 0;
    border-top: 1px solid var(--ssl-line);
}

/* --- loading + empty states --------------------------------------------- */

/* Skeleton cards rather than a spinner: the layout does not jump when the
   real cards arrive, which is most of what a spinner costs you. */
.ssl-skeleton {
    border-radius: var(--ssl-radius-lg);
    border: 1px solid var(--ssl-line);
    background: var(--ssl-panel);
    min-height: 268px;
    position: relative;
    overflow: hidden;
}

.ssl-skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
    transform: translateX(-100%);
    animation: ssl-shimmer 1.4s infinite;
}

@keyframes ssl-shimmer {
    to { transform: translateX(100%); }
}

.ssl-empty {
    text-align: center;
    padding: 3.5rem 1.5rem;
    border: 1px dashed var(--ssl-line-strong);
    border-radius: var(--ssl-radius-lg);
    color: var(--ssl-muted);
}

.ssl-empty h3 { margin-bottom: 0.5rem; }

/* --- notices ------------------------------------------------------------ */

.ssl-notice {
    border-radius: var(--ssl-radius);
    border: 1px solid var(--ssl-line-strong);
    border-left-width: 3px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.94rem;
    line-height: 1.6;
}

.ssl-notice p:last-child { margin-bottom: 0; }

.ssl-notice-good { border-left-color: var(--ssl-good); }
.ssl-notice-warn { border-left-color: var(--ssl-warn); }
.ssl-notice-bad  { border-left-color: var(--ssl-bad); }
.ssl-notice-info { border-left-color: var(--ssl-accent); }

/* --- configure page ----------------------------------------------------- */

.ssl-configure {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 2rem;
    align-items: start;
}

@media screen and (max-width: 980px) {
    .ssl-configure { grid-template-columns: minmax(0, 1fr); }
}

.ssl-step {
    border: 1px solid var(--ssl-line);
    border-radius: var(--ssl-radius-lg);
    padding: 1.75rem;
    margin: 0 0 1.5rem;
    background: var(--ssl-panel);
}

.ssl-step > legend {
    padding: 0 0.6rem;
    margin-left: -0.6rem;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.ssl-step-hint {
    color: var(--ssl-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: -0.35rem 0 1.4rem;
}

.ssl-field { margin-bottom: 1.5rem; }
.ssl-field:last-child { margin-bottom: 0; }

.ssl-field > label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.ssl-field-note {
    display: block;
    color: var(--ssl-faint);
    font-size: 0.82rem;
    line-height: 1.55;
    margin-top: 0.5rem;
}

/* Inline validation. Both states are announced, not just coloured, because a
   red border alone says nothing to a screen reader or to anyone who cannot
   distinguish it from the default. */
.ssl-field-error {
    display: none;
    color: var(--ssl-bad);
    font-size: 0.84rem;
    margin-top: 0.5rem;
}

.ssl-field.has-error .ssl-field-error { display: block; }
.ssl-field.has-error input,
.ssl-field.has-error textarea,
.ssl-field.has-error select { border-color: var(--ssl-bad) !important; }

.ssl-field.is-valid input { border-color: rgba(135, 197, 164, 0.7) !important; }

/* Radio and checkbox cards: a control, a heading and an explanation, all one
   click target.
   ---------------------------------------------------------------------------
   The markup has to be `input` followed by a sibling `label`, not an input
   nested inside one. main.css hides the native control outright
   (appearance:none; opacity:0; z-index:-1) and redraws it as a ::before on the
   *adjacent* label -- so nesting the input produces a card with no visible
   control at all. Keeping the sibling shape means these use the same tickbox
   as the rest of the site, in the same accent colour, for free.
   ------------------------------------------------------------------------- */
.ssl-choices {
    display: grid;
    gap: 0.75rem;
}

.ssl-choice {
    border: 1px solid var(--ssl-line);
    border-radius: var(--ssl-radius);
    padding: 1rem 1.15rem;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.ssl-choice:hover { background: var(--ssl-panel-hover); }

.ssl-choice:has(input:checked) {
    border-color: var(--ssl-accent);
    background: rgba(155, 241, 255, 0.07);
}

/* main.css styles every `label` as a field label: 0.8em, 600 weight,
   uppercase, 0.25em letter-spacing. Correct above a text input, wrong for a
   sentence explaining an option -- it renders as shouting. Reset it here and
   only here. */
.ssl-choice label {
    display: block;
    margin: 0;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
}

.ssl-choice label strong {
    display: block;
    font-size: 0.94rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    margin-bottom: 0.2rem;
}

.ssl-choice label .ssl-choice-detail {
    display: block;
    color: var(--ssl-muted);
    font-size: 0.86rem;
    line-height: 1.55;
    font-weight: 400;
}

.ssl-choice label .ssl-mono {
    font-size: 0.86rem;
    text-transform: none;
    letter-spacing: normal;
}

.ssl-csr-input {
    font-family: "Courier New", monospace;
    font-size: 0.82rem;
    line-height: 1.45;
    min-height: 190px;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

.ssl-csr-summary {
    display: none;
    margin-top: 0.9rem;
    padding: 0.9rem 1.1rem;
    border-radius: var(--ssl-radius);
    border: 1px solid rgba(135, 197, 164, 0.45);
    background: rgba(135, 197, 164, 0.08);
    font-size: 0.86rem;
}

.ssl-csr-summary.is-visible { display: block; }
.ssl-csr-summary dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; }
.ssl-csr-summary dt { color: var(--ssl-muted); font-weight: 400; margin: 0; }
.ssl-csr-summary dd { margin: 0; }

/* --- order summary (sticky) --------------------------------------------- */

.ssl-summary {
    position: sticky;
    top: 1.5rem;
    border: 1px solid var(--ssl-line);
    border-radius: var(--ssl-radius-lg);
    background: var(--ssl-panel);
    padding: 1.6rem;
}

@media screen and (max-width: 980px) {
    .ssl-summary { position: static; }
}

.ssl-summary h2 {
    font-size: 1rem;
    letter-spacing: 0.06em;
    margin-bottom: 1.2rem;
}

.ssl-summary dl {
    margin: 0 0 1.3rem;
    font-size: 0.88rem;
}

.ssl-summary dl > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
    border-top: 1px solid var(--ssl-line);
}

.ssl-summary dl > div:first-child { border-top: 0; }
.ssl-summary dt { color: var(--ssl-muted); margin: 0; font-weight: 400; }
.ssl-summary dd { margin: 0; text-align: right; word-break: break-word; }

.ssl-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-top: 1rem;
    border-top: 1px solid var(--ssl-line-strong);
    margin-bottom: 1.3rem;
}

.ssl-summary-total strong { font-size: 1.5rem; font-weight: 600; }

/* --- order tracking ----------------------------------------------------- */

.ssl-track {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin: 0 0 2rem;
    padding: 0;
    list-style: none;
    counter-reset: ssl-step;
}

@media screen and (max-width: 736px) {
    .ssl-track { grid-template-columns: 1fr; }
}

.ssl-track li {
    padding: 0.9rem 0 0;
    border-top: 3px solid var(--ssl-line);
    color: var(--ssl-faint);
    font-size: 0.86rem;
}

.ssl-track li strong {
    display: block;
    font-size: 0.94rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
    color: inherit;
}

.ssl-track li.is-done    { border-top-color: var(--ssl-good); color: var(--ssl-muted); }
.ssl-track li.is-current { border-top-color: var(--ssl-accent); color: #fff; }

.ssl-status-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 1rem;
    padding: 1.15rem 1.4rem;
    border-radius: var(--ssl-radius);
    border: 1px solid var(--ssl-line-strong);
    border-left-width: 3px;
    margin-bottom: 2rem;
}

.ssl-status-banner strong { font-size: 1.05rem; }
.ssl-status-banner p { margin: 0; color: var(--ssl-muted); font-size: 0.92rem; }

.ssl-status-pending  { border-left-color: var(--ssl-warn); }
.ssl-status-progress { border-left-color: var(--ssl-accent); }
.ssl-status-good     { border-left-color: var(--ssl-good); }
.ssl-status-bad      { border-left-color: var(--ssl-bad); }
.ssl-status-muted    { border-left-color: var(--ssl-line-strong); }

/* Copyable value: a DCV file body, a CNAME target, a PEM block. */
.ssl-copy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: start;
    margin-bottom: 1rem;
}

.ssl-copy pre {
    margin: 0;
    padding: 0.85rem 1rem;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--ssl-line);
    border-radius: var(--ssl-radius);
    font-size: 0.8rem;
    line-height: 1.5;
    max-height: 260px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.ssl-copy button { margin: 0; white-space: nowrap; }

.ssl-kv {
    margin: 0 0 1.5rem;
    font-size: 0.9rem;
}

.ssl-kv > div {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 0.5rem 1rem;
    padding: 0.55rem 0;
    border-top: 1px solid var(--ssl-line);
}

@media screen and (max-width: 736px) {
    .ssl-kv > div { grid-template-columns: 1fr; gap: 0.15rem; }
}

.ssl-kv > div:first-child { border-top: 0; }
.ssl-kv dt { color: var(--ssl-muted); margin: 0; font-weight: 400; }
.ssl-kv dd { margin: 0; word-break: break-word; }

.ssl-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.88rem;
}

.ssl-timeline li {
    padding: 0.7rem 0 0.7rem 1.4rem;
    border-left: 1px solid var(--ssl-line);
    position: relative;
    color: var(--ssl-muted);
}

.ssl-timeline li::before {
    content: '';
    position: absolute;
    left: -4.5px;
    top: 1.15rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ssl-line-strong);
}

.ssl-timeline li:last-child::before { background: var(--ssl-accent); }
.ssl-timeline li strong { color: #fff; display: block; }
.ssl-timeline time { display: block; color: var(--ssl-faint); font-size: 0.8rem; margin-top: 0.1rem; }

/* --- order list on my-orders.php ---------------------------------------- */

.ssl-order-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.ssl-order-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.25rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--ssl-line);
    border-radius: var(--ssl-radius);
    background: var(--ssl-panel);
}

.ssl-order-list .ssl-order-domain { font-weight: 600; }
.ssl-order-list .ssl-order-meta { color: var(--ssl-muted); font-size: 0.86rem; }
.ssl-order-list .ssl-order-action { margin-left: auto; }

/* --- accessibility ------------------------------------------------------ */

.ssl-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;
}

.ssl-page :focus-visible {
    outline: 2px solid var(--ssl-accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .ssl-card,
    .ssl-chip,
    .ssl-choice { transition: none; }

    .ssl-skeleton::after { animation: none; }
}
