/* ------------------------------------------------------------------
   [db]netsoft Licensing - public pages
   Loaded after dbnetsoft.public.css (dbnetsoft.Web.Theme), which holds
   the look the [db]netsoft websites share: fonts, colours, top bar,
   buttons, sections, plain pages, forms, footer. This file adds what is
   Licensing's own: the licence key field, large on the asphalt band of
   the front page; the downloads and activations tables; the licences.
   Loaded by Pages/Shared/_Layout.cshtml, which the public pages and,
   through _AuthLayout, the Identity pages use. The Admin area keeps
   dbnetsoft.admin.css in its own layout and is not affected.
   ------------------------------------------------------------------ */

/* ---------- front page: the licence check on asphalt ---------- */

.ds-hero {
    background: var(--ds-asphalt);
    color: var(--ds-on-asphalt);
    padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.ds-hero :focus-visible {
    outline-color: var(--ds-signal);
}

.ds-hero__title {
    font-size: clamp(2.25rem, 4.5vw, 3.5rem);
    line-height: .95;
    margin: 0 0 1.25rem;
    max-width: 22ch;
}

.ds-hero__lead {
    color: var(--ds-on-asphalt-muted);
    font-size: 1.1875rem;
    line-height: 1.55;
    max-width: 38rem;
    margin: 0 0 2.25rem;
}

/* label, then the key field and its button in one row, then the hint */
.ds-check {
    max-width: 48rem;
}

.ds-check__label {
    display: block;
    margin-bottom: .5rem;
    font-weight: 600;
}

.ds-check__row {
    display: flex;
    gap: .75rem;
}

.ds-check__row .ds-btn {
    flex: 0 0 auto;
}

.ds-check__hint {
    margin: .6rem 0 0;
    color: var(--ds-on-asphalt-muted);
    font-size: .9375rem;
}

/* The key as people type it, large, in tabular figures with a slashed zero where the font has one,
   so O and 0 are harder to mix up. */
.ds-key {
    flex: 1 1 auto;
    min-width: 0;
    padding: .55rem .9rem;
    background: var(--ds-paper);
    border: 2px solid var(--ds-paper);
    border-radius: var(--ds-radius);
    color: var(--ds-text);
    font-family: var(--ds-condensed);
    font-size: clamp(1.375rem, 3vw, 2rem);
    font-weight: 600;
    letter-spacing: .06em;
    line-height: 1.2;
    font-variant-numeric: tabular-nums slashed-zero;
    text-transform: uppercase;
}

.ds-key::placeholder {
    color: #a3a8ad;
    letter-spacing: .06em;
}

.ds-key:focus {
    outline: none;
    border-color: var(--ds-signal);
    box-shadow: 0 0 0 3px var(--ds-signal);
}

/* the same field on a white page (Activations) */
.ds-check--page {
    margin: 0 0 2.5rem;
}

.ds-check--page .ds-key {
    border-color: #9aa0a5;
}

.ds-check--page .ds-key:focus {
    border-color: var(--ds-text);
}

/* ---------- sections ---------- */

.ds-page__lead {
    color: var(--ds-muted);
    font-size: 1.125rem;
    max-width: var(--ds-measure);
    margin: 0 0 2rem;
}

.ds-section__foot {
    margin: 1.5rem 0 0;
}

/* ---------- tables (downloads, software, activations) ---------- */

.ds-table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.ds-table > thead > tr > th {
    border-bottom: 2px solid var(--ds-text);
    color: var(--ds-text);
    font-size: .9375rem;
    font-weight: 600;
    white-space: nowrap;
}

.ds-table > tbody > tr > td {
    border-bottom-color: var(--ds-line);
    padding-block: .8rem;
    vertical-align: middle;
}

.ds-table > :not(caption) > * > :first-child {
    padding-left: 0;
}

.ds-table > :not(caption) > * > :last-child {
    padding-right: 0;
}

.ds-table__name {
    font-weight: 600;
}

.ds-versions {
    display: flex;
    flex-wrap: wrap;
    gap: .15rem 1rem;
}

/* ---------- licences and activations ---------- */

.ds-licence {
    margin-bottom: 3rem;
}

.ds-licence-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    padding-bottom: .75rem;
}

.ds-licence-head h2 {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.1;
}

.ds-licence-dates {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1.25rem;
    margin-left: auto;
    font-size: .9375rem;
}

/* the licence's state, as a small sign: green when it works, red when it does not */
.ds-status {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: var(--ds-radius);
    color: #fff;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.3;
}

.ds-status--on {
    background: var(--ds-on);
}

.ds-status--off {
    background: var(--ds-off);
}

.ds-status--quiet {
    background: var(--ds-concrete);
    color: var(--ds-text);
}

.ds-label {
    color: var(--ds-muted);
}

.ds-activations > tbody > tr > td {
    vertical-align: top;
}

.ds-activations .ds-label {
    font-size: .875rem;
}

.ds-live {
    color: var(--ds-on);
}

/* the column heading says it on wider screens */
.ds-phone-only {
    display: none;
}

.ds-facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: .1rem .9rem;
    margin: 0;
    font-size: .875rem;
}

.ds-facts dt {
    color: var(--ds-muted);
    font-weight: 400;
}

.ds-facts dd {
    margin: 0;
    font-weight: 500;
    overflow-wrap: anywhere;
}

/* ---------- Identity pages and cards ---------- */

/* the Identity UI pages (log in, manage account) render straight into _AuthLayout's .ds-auth */
.ds-auth h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--ds-muted);
    font-family: var(--ds-sans);
    font-size: 1.0625rem;
    font-weight: 400;
}

.ds-auth h3 {
    font-family: var(--ds-sans);
    font-size: 1.0625rem;
    font-weight: 600;
}

.ds-auth section,
.ds-auth form {
    max-width: 28rem;
}

.ds-auth .nav-pills .nav-link {
    border-radius: 0;
    border-left: 4px solid transparent;
    color: var(--ds-muted);
    font-weight: 500;
}

.ds-auth .nav-pills .nav-link:hover {
    color: var(--ds-text);
    background: var(--ds-concrete);
}

.ds-auth .nav-pills .nav-link.active {
    background: transparent;
    border-left-color: var(--ds-signal);
    color: var(--ds-text);
    font-weight: 600;
}

/* the Error and Migrations pages keep Bootstrap cards, drawn flat */
.ds-page .card {
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius);
    box-shadow: none;
    margin-bottom: 1.5rem;
}

.ds-page .card-header {
    background: var(--ds-concrete);
    border-bottom: 0;
}

.ds-page .card-title {
    margin: 0;
    font-family: var(--ds-sans);
    font-size: 1.0625rem;
    font-weight: 600;
}

/* ---------- phones ---------- */

@media (max-width: 575.98px) {
    /* field and button under each other, so the whole key stays visible */
    .ds-check__row {
        flex-direction: column;
    }

    .ds-key {
        font-size: 1.25rem;
        letter-spacing: .03em;
    }

    .ds-licence-dates {
        margin-left: 0;
        flex: 1 1 100%;
    }

    /* each activation becomes a block: what it is, when, and the machine under each other */
    .ds-activations > thead {
        display: none;
    }

    .ds-activations > tbody > tr {
        display: block;
        padding-block: .75rem;
        border-bottom: 1px solid var(--ds-line);
    }

    .ds-activations > tbody > tr > td {
        display: block;
        border: 0;
        padding: .15rem 0;
    }

    /* Razor leaves whitespace in an empty cell, so :empty would not match */
    .ds-activations > tbody > tr > td:not(:has(*)) {
        display: none;
    }

    .ds-activations .ds-phone-only {
        display: inline;
    }

    .ds-activations > tbody > tr > td[data-label="Machine"] {
        padding-top: .5rem;
    }
}

/* ---------- release notes: a product's history.txt, formatted (page and dialog) ---------- */

.ds-rn__release {
    padding-block: 1.25rem .5rem;
}

.ds-rn__release + .ds-rn__release {
    border-top: 1px solid var(--ds-line);
}

.ds-rn .ds-rn__version {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .25rem .75rem;
    margin: 0 0 .75rem;
    font-family: var(--ds-condensed);
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.1;
}

.ds-rn__date {
    color: var(--ds-muted);
    font-family: var(--ds-sans);
    font-size: .875rem;
    font-weight: 400;
}

.ds-page .ds-rn__entries li,
.ds-rn__entries li {
    max-width: none;
}

.ds-rn__entries {
    display: grid;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ds-rn__entries li {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    line-height: 1.5;
}

/* the kind of change as a small sign, like the licence states */
.ds-rn__kind {
    flex: 0 0 4.75rem;
    padding: .1rem 0;
    border-radius: var(--ds-radius);
    background: var(--ds-concrete);
    color: var(--ds-text);
    font-size: .75rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.ds-rn__kind--added,
.ds-rn__kind--new {
    background: var(--ds-on);
    color: #fff;
}

.ds-rn__kind--fixed {
    background: var(--ds-off);
    color: #fff;
}

.ds-rn__kind--changed,
.ds-rn__kind--improved {
    background: var(--ds-signal);
}

.ds-rn__foot {
    margin-top: 2rem;
    color: var(--ds-muted);
}

.ds-rn__loading {
    padding-block: 1.25rem;
    color: var(--ds-muted);
}

.ds-rn-dialog {
    width: min(48rem, calc(100vw - 2rem));
    max-height: min(85vh, 60rem);
    padding: 0;
    border: 0;
    border-radius: var(--ds-radius);
    background: var(--ds-paper);
    color: var(--ds-text);
    box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, .35);
    flex-direction: column;
}

.ds-rn-dialog[open] {
    display: flex;
}

.ds-rn-dialog::backdrop {
    background: rgba(38, 41, 44, .7);
}

.ds-rn-dialog__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--ds-asphalt);
    color: var(--ds-on-asphalt);
    border-bottom: 4px solid var(--ds-signal);
}

.ds-rn-dialog__title {
    margin: 0;
    color: inherit;
    font-family: var(--ds-condensed);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.ds-rn-dialog__close {
    padding: .25rem .5rem;
    border: 0;
    background: none;
    color: var(--ds-on-asphalt-muted);
    font-size: 1.125rem;
    line-height: 1;
    cursor: pointer;
}

.ds-rn-dialog__close:hover,
.ds-rn-dialog__close:focus-visible {
    color: var(--ds-signal);
}

.ds-rn-dialog__body {
    overflow-y: auto;
    padding: 0 1.5rem 1.25rem;
}

.ds-rn-dialog__foot {
    padding: .75rem 1.5rem;
    border-top: 1px solid var(--ds-line);
    font-size: .875rem;
}

@media (max-width: 575.98px) {
    .ds-rn__entries li {
        flex-direction: column;
        gap: .25rem;
    }

    .ds-rn__kind {
        flex-basis: auto;
        padding-inline: .5rem;
    }
}
