/* Layered on the FOD design tokens loaded by main.css, so colours stay consistent with the
   rest of the Prasada apps. Fallbacks keep the page readable if FOD ever fails to load. */

:root {
    --pv-text: var(--color-text-base-default, #1a1d21);
    --pv-text-secondary: var(--color-text-base-secondary, #52585f);
    --pv-brand: var(--color-text-brand-default, #0058d2);
    --pv-border: var(--color-border-base-default, #d6dae0);
    --pv-surface: var(--color-background-base-secondary, #f5f7fa);
    --pv-positive: var(--color-text-positive-default, #1a7f45);
    --pv-danger: var(--color-text-danger-default, #c22b2b);
    --pv-radius: var(--radius-12, 12px);
    --pv-radius-sm: var(--radius-6, 6px);
}

body {
    margin: 0;
    color: var(--pv-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.55;
}

.pv-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.pv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--pv-border);
}

.pv-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    color: inherit;
}

.pv-brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: var(--pv-radius-sm);
    background: var(--pv-brand);
    color: #fff;
    font-weight: 700;
    letter-spacing: .02em;
}

.pv-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.pv-brand-text small {
    color: var(--pv-text-secondary);
    font-size: .8rem;
}

.pv-nav {
    display: flex;
    gap: 1.25rem;
}

.pv-nav a {
    color: var(--pv-text-secondary);
    text-decoration: none;
}

.pv-nav a:hover {
    color: var(--pv-brand);
}

.pv-main {
    flex: 1;
    width: min(1080px, 100% - 3rem);
    margin-inline: auto;
    padding: 2.5rem 0 4rem;
}

.pv-footer {
    border-top: 1px solid var(--pv-border);
    padding: 1.25rem 1.5rem;
    color: var(--pv-text-secondary);
    font-size: .875rem;
}

.pv-footer p {
    width: min(1080px, 100%);
    margin-inline: auto;
}

h1 {
    font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
    margin: 0 0 .75rem;
}

.pv-hero {
    max-width: 62ch;
}

.pv-lead,
.pv-hero p {
    color: var(--pv-text-secondary);
}

.pv-cta {
    display: inline-block;
    margin-top: 1.25rem;
    padding: .7rem 1.4rem;
    border: 0;
    border-radius: var(--pv-radius-sm);
    background: var(--pv-brand);
    color: #fff;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.pv-secondary {
    margin-top: 1.5rem;
    padding: .6rem 1.2rem;
    border: 1px solid var(--pv-border);
    border-radius: var(--pv-radius-sm);
    background: transparent;
    color: var(--pv-text);
    font: inherit;
    cursor: pointer;
}

.pv-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-top: 3rem;
}

.pv-facts article {
    padding: 1.25rem;
    border: 1px solid var(--pv-border);
    border-radius: var(--pv-radius);
    background: var(--pv-surface);
}

.pv-facts h2 {
    margin: 0 0 .5rem;
    font-size: 1.05rem;
}

.pv-facts p {
    margin: 0;
    color: var(--pv-text-secondary);
    font-size: .925rem;
}

.pv-credential-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.pv-credential-card {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: 1.1rem;
    border: 1px solid var(--pv-border);
    border-left: 4px solid var(--card-accent, var(--pv-brand));
    border-radius: var(--pv-radius);
    background: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.pv-credential-card:hover:not(:disabled) {
    border-color: var(--pv-brand);
}

.pv-credential-card:disabled {
    opacity: .6;
    cursor: progress;
}

.pv-credential-country {
    align-self: flex-start;
    padding: .1rem .5rem;
    border-radius: 999px;
    background: var(--pv-surface);
    color: var(--pv-text-secondary);
    font-size: .75rem;
    font-weight: 600;
}

.pv-credential-name {
    font-weight: 600;
}

.pv-credential-format {
    color: var(--pv-brand);
    font-size: .8rem;
    font-weight: 600;
}

.pv-credential-type {
    color: var(--pv-text-secondary);
    font-size: .75rem;
    overflow-wrap: anywhere;
}

.pv-scan {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    align-items: start;
    margin-top: 1.5rem;
}

.pv-scan-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    padding: 1.25rem;
    border: 1px solid var(--pv-border);
    border-radius: var(--pv-radius);
    background: #fff;
}

.pv-scan-qr img {
    max-width: 100%;
    height: auto;
}

.pv-deeplink {
    color: var(--pv-brand);
    font-size: .9rem;
}

.pv-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .35rem 1rem;
    margin: 1.25rem 0 0;
    font-size: .9rem;
}

.pv-meta dt {
    color: var(--pv-text-secondary);
}

.pv-meta dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.pv-alert {
    padding: .9rem 1.1rem;
    border-radius: var(--pv-radius-sm);
    margin-bottom: 1.5rem;
}

.pv-alert p {
    margin: .4rem 0 0;
}

.pv-alert-success {
    border: 1px solid var(--pv-positive);
    color: var(--pv-positive);
    background: color-mix(in srgb, var(--pv-positive) 8%, transparent);
}

.pv-alert-error {
    border: 1px solid var(--pv-danger);
    color: var(--pv-danger);
    background: color-mix(in srgb, var(--pv-danger) 8%, transparent);
}

.pv-claims {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: .75rem;
    margin-top: 1rem;
}

.pv-claim {
    display: flex;
    flex-direction: column;
    padding: .75rem 1rem;
    border: 1px solid var(--pv-border);
    border-radius: var(--pv-radius-sm);
    background: var(--pv-surface);
}

.pv-claim-name {
    color: var(--pv-text-secondary);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.pv-claim-value {
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* A portrait or signature is the one attribute worth seeing at a glance, so give it room rather than
   letting it sit in the same cramped cell as a date of birth. */
.pv-claim-image {
    align-items: flex-start;
}

.pv-claim-picture {
    max-width: 100%;
    max-height: 220px;
    width: auto;
    margin-top: .5rem;
    border: 1px solid var(--pv-border);
    border-radius: var(--pv-radius-sm);
    /* Signatures are transparent PNGs; on the tinted claim card they would otherwise be near-invisible. */
    background: #fff;
    object-fit: contain;
}

.pv-muted {
    color: var(--pv-text-secondary);
}

.pv-toggle {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    max-width: 62ch;
    margin: 1.25rem 0 0;
    padding: .9rem 1.1rem;
    border: 1px dashed var(--pv-border);
    border-radius: var(--pv-radius);
    cursor: pointer;
}

.pv-toggle input {
    margin-top: .25rem;
}

.pv-toggle span {
    display: flex;
    flex-direction: column;
}

.pv-toggle small {
    color: var(--pv-text-secondary);
}

.pv-runs-heading {
    margin-top: 2.5rem;
}

.pv-run {
    margin-top: 1.25rem;
    padding: 1.1rem;
    border: 1px solid var(--pv-border);
    border-radius: var(--pv-radius);
}

.pv-run-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
}

.pv-run-badge {
    padding: .15rem .6rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.pv-run-ok {
    color: var(--pv-positive);
    background: color-mix(in srgb, var(--pv-positive) 12%, transparent);
}

.pv-run-bad {
    color: var(--pv-danger);
    background: color-mix(in srgb, var(--pv-danger) 12%, transparent);
    text-transform: none;
    letter-spacing: 0;
}

.pv-run-id {
    color: var(--pv-text-tertiary, var(--pv-text-secondary));
    font-size: .78rem;
}

.pv-run-error {
    margin: 0;
    color: var(--pv-danger);
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .875em;
}
