/* ====================================================================== */
/*  Pintor Project SpA - brand system                                     */
/*  Light, warm, editorial-clean: cream surfaces, navy text, orange       */
/*  accent. Plus Jakarta Sans (display) / DM Sans (UI) / JetBrains Mono.   */
/* ====================================================================== */

:root {
    /* Brand */
    --navy:   #1B2838;   /* foreground + dark bands */
    --deep:   #243447;
    --blue:   #0077B6;
    --teal:   #00B4D8;
    --orange: #E8845A;   /* signature accent */
    --orange-hover: #D4703F;
    --orange-deep:  #C4572E;

    /* Light surfaces */
    --cream:  #FAFAF8;
    --sand:   #F5F3EF;
    --warm:   #EDE9E3;
    --card:   #FFFFFF;
    --border: #E5E1DB;
    --border-strong: #D8D2C8;

    /* Text */
    --fg:       #1B2838;
    --fg-muted: #6B7280;
    --fg-dim:   #9AA1AC;
    --on-dark:  #F3EFE9;
    --on-dark-muted: #B9C0CB;

    /* Semantic status - DISTINCT from the orange brand accent */
    --st-implemented: #27AE60;
    --st-partial:     #D4A03F;
    --st-planned:     #64748B;

    /* Type */
    --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
    --font-sans:    'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --radius: 0.75rem;

    /* Gradients */
    --grad-aurora: linear-gradient(-45deg, #1B2838, #243447, #3D2B1F, #E8845A, #3D2B1F, #243447, #1B2838);
    --grad-headline: linear-gradient(135deg, #E8845A, #D4703F);
}

* { box-sizing: border-box; }

html { font-size: 17px; }
html, body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--cream);
    color: var(--fg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
h1:focus { outline: none; }

a, .btn-link { color: var(--orange-hover); text-decoration: none; }
a:hover { color: var(--orange-deep); text-decoration: underline; }

code {
    font-family: var(--font-mono);
    color: var(--orange-deep);
    background: rgba(232, 132, 90, 0.10);
    padding: 0.05em 0.35em; border-radius: 0.25rem; font-size: 0.88em;
}

.overline {
    font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.14em; color: var(--orange-hover); margin: 0 0 0.4rem;
}

/* ---------------------------------------------------------------------- */
/*  Boot loader + error UI                                                 */
/* ---------------------------------------------------------------------- */
.loading-progress {
    position: relative; display: block; width: 8rem; height: 8rem; margin: 30vh auto 1rem auto;
}
.loading-progress circle {
    fill: none; stroke: var(--warm); stroke-width: 0.5rem;
    transform-origin: 50% 50%; transform: rotate(-90deg);
}
.loading-progress circle:last-child {
    stroke: var(--orange);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}
.loading-progress-text {
    position: absolute; text-align: center; font-weight: 600;
    color: var(--fg-muted); inset: calc(30vh + 3.25rem) 0 auto 0.2rem;
}
.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Loading"); }

#blazor-error-ui {
    background: #FBF4EE; color: var(--navy);
    border-top: 1px solid var(--orange);
    bottom: 0; left: 0; width: 100%; position: fixed; z-index: 1000;
    display: none; padding: 0.7rem 1.25rem; box-shadow: 0 -2px 16px rgba(27, 40, 56, 0.12);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
#blazor-error-ui .reload { color: var(--orange-hover); }

/* ====================================================================== */
/*  PUBLIC LANDING - dark navy band with warm aurora                      */
/* ====================================================================== */
.landing-root { min-height: 100vh; }

.landing {
    min-height: 100vh; display: flex; flex-direction: column;
    position: relative; overflow: hidden;
    background: linear-gradient(180deg, #16212f, #1B2838 55%, #243447);
    color: var(--on-dark);
}
.landing__aurora {
    position: absolute; inset: -35% -15% auto -15%; height: 95vh; z-index: 0;
    background: var(--grad-aurora); background-size: 400% 400%;
    filter: blur(90px); opacity: 0.5; animation: aurora 22s ease infinite; pointer-events: none;
}
@keyframes aurora {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) { .landing__aurora { animation: none; } }

.landing__nav {
    position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between;
    padding: 1.75rem clamp(1.5rem, 6vw, 5rem);
}
.landing__brand { display: flex; align-items: center; gap: 0.75rem; }
.landing__brand img { width: 2.25rem; height: 2.25rem; }
.landing__brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--on-dark); }
.landing__signin-link {
    background: none; border: 1px solid rgba(243, 239, 233, 0.28); color: var(--on-dark);
    font-family: var(--font-sans); font-size: 0.92rem; font-weight: 500;
    padding: 0.5rem 1.1rem; border-radius: 0.5rem; cursor: pointer; transition: all 0.15s ease;
}
.landing__signin-link:hover { border-color: var(--orange); color: #fff; background: rgba(232, 132, 90, 0.14); }

.landing__hero {
    position: relative; z-index: 2; flex: 1;
    display: flex; flex-direction: column; justify-content: center;
    padding: clamp(2rem, 8vh, 6rem) clamp(1.5rem, 6vw, 5rem); max-width: 62rem;
}
.landing__logo-lg {
    width: 5rem; height: 5rem; margin-bottom: 2rem;
    filter: drop-shadow(0 10px 28px rgba(232, 132, 90, 0.35));
}
.landing__hero h1 {
    font-size: clamp(2.5rem, 7vw, 4rem); font-weight: 800; line-height: 1.04;
    letter-spacing: -0.02em; margin: 0 0 1.25rem; color: #fff;
}
.landing__hero h1 .grad {
    background: var(--grad-headline); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
.landing__trust {
    font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--on-dark-muted);
    max-width: 42rem; line-height: 1.55; margin: 0 0 2.5rem;
}
.landing__trust strong { color: #fff; font-weight: 600; }

.landing__cta {
    display: inline-flex; align-items: center; gap: 0.55rem; align-self: flex-start;
    background: var(--orange); color: #241009; font-family: var(--font-sans);
    font-weight: 700; font-size: 1rem; padding: 0.85rem 1.8rem; border-radius: 0.6rem;
    border: none; cursor: pointer; box-shadow: 0 10px 32px rgba(232, 132, 90, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.landing__cta:hover {
    background: #F0946C; color: #241009; text-decoration: none;
    transform: translateY(-1px); box-shadow: 0 14px 40px rgba(232, 132, 90, 0.5);
}
.landing__cta svg { width: 1.1rem; height: 1.1rem; }

.landing__footer {
    position: relative; z-index: 2; padding: 1.5rem clamp(1.5rem, 6vw, 5rem);
    border-top: 1px solid rgba(243, 239, 233, 0.14); color: var(--on-dark-muted);
    font-size: 0.85rem; display: flex; gap: 0.5rem; align-items: center;
}
.landing__footer .dot { color: var(--orange); }

/* ====================================================================== */
/*  AUTHENTICATED APP SHELL (light)                                        */
/* ====================================================================== */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }

.sidebar { background: var(--card); border-right: 1px solid var(--border); }

.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    height: 3.75rem; padding: 0 1.75rem;
    background: rgba(250, 250, 248, 0.85); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.topbar__title { display: flex; align-items: center; gap: 0.55rem; }
.topbar__title img { width: 1.4rem; height: 1.4rem; }
.topbar__title .name { font-family: var(--font-display); font-weight: 600; font-size: 0.92rem; }
.topbar__title .sep { color: var(--fg-dim); }
.topbar__title .sub { color: var(--fg-muted); font-size: 0.82rem; letter-spacing: 0.05em; }

main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.content { padding: 2.25rem clamp(1.25rem, 4vw, 2.75rem) 4rem; max-width: 88rem; width: 100%; }

@media (min-width: 641px) {
    .app-shell { flex-direction: row; }
    .sidebar { width: 260px; height: 100vh; position: sticky; top: 0; flex-shrink: 0; }
    .topbar { position: sticky; top: 0; z-index: 5; }
}

/* Sidebar brand + nav */
.nav-brand {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 1.35rem 1.35rem 1.15rem; border-bottom: 1px solid var(--border);
}
.nav-brand img { width: 1.9rem; height: 1.9rem; }
.nav-brand__name { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; line-height: 1.1; }
.nav-brand__sub { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--orange-hover); }

.nav-section {
    padding: 1.25rem 1rem 0.5rem 1.4rem; font-size: 0.68rem; font-weight: 600;
    letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-dim);
}
.nav-list { display: flex; flex-direction: column; gap: 0.15rem; padding: 0 0.75rem; }
.nav-link {
    display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.8rem; border-radius: 0.55rem;
    color: var(--navy); font-size: 0.92rem; font-weight: 500; text-decoration: none;
    transition: background 0.12s ease, color 0.12s ease;
}
.nav-link:hover { background: var(--sand); color: var(--navy); text-decoration: none; }
.nav-link.active {
    background: rgba(232, 132, 90, 0.12); color: var(--orange-deep); font-weight: 600;
    box-shadow: inset 3px 0 0 var(--orange);
}
.nav-link svg { width: 1.05rem; height: 1.05rem; flex-shrink: 0; opacity: 0.9; }

.nav-toggler {
    display: none; margin-left: auto; background: var(--sand); border: 1px solid var(--border);
    color: var(--navy); border-radius: 0.4rem; padding: 0.3rem 0.45rem; cursor: pointer;
}
.nav-toggler svg { width: 1.1rem; height: 1.1rem; display: block; }
@media (max-width: 640.98px) {
    .nav-toggler { display: inline-flex; }
    .nav-collapsed { display: none; }
}

/* Login display */
.login-display { display: flex; align-items: center; gap: 0.6rem; font-size: 0.86rem; }
.login-name { font-weight: 600; color: var(--navy); }
.link-button { background: none; border: none; color: var(--orange-hover); cursor: pointer; padding: 0; font: inherit; }
.link-button:hover { text-decoration: underline; }
.role-pill { font-size: 0.66rem; font-weight: 600; padding: 0.12rem 0.5rem; border-radius: 999px; }
.role-admin  { background: rgba(232, 132, 90, 0.16); color: var(--orange-deep); border: 1px solid rgba(232, 132, 90, 0.4); }
.role-viewer { background: var(--sand); color: var(--fg-muted); border: 1px solid var(--border); }

/* ---------------------------------------------------------------------- */
/*  Page typography                                                        */
/* ---------------------------------------------------------------------- */
.content h1 { font-size: 2.5rem; font-weight: 700; margin: 0 0 0.4rem; }
.content h2 { font-size: 1.5rem; font-weight: 700; }
.lead { color: var(--fg-muted); max-width: 62rem; font-size: 1.02rem; line-height: 1.55; margin: 0 0 1.5rem; }
.hint { color: var(--fg-dim); font-size: 0.85rem; }
.mt-2 { margin-top: 0.5rem; }
.nowrap { white-space: nowrap; }

.skeleton-block {
    color: var(--fg-muted); background: var(--sand); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 2rem; text-align: center; margin: 1.5rem 0;
}

/* Buttons + callouts */
.btn-primary {
    display: inline-flex; align-items: center; gap: 0.4rem; background: var(--orange); color: #241009;
    font-family: var(--font-sans); font-weight: 600; padding: 0.5rem 1rem; border: none;
    border-radius: 0.55rem; cursor: pointer; font-size: 0.9rem; text-decoration: none;
    transition: background 0.12s ease, transform 0.12s ease;
}
.btn-primary:hover { background: var(--orange-hover); color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.6; cursor: default; transform: none; }

.btn-ghost {
    background: var(--card); color: var(--navy); border: 1px solid var(--border-strong);
    font-family: var(--font-sans); font-weight: 500; padding: 0.4rem 0.85rem; border-radius: 0.5rem;
    cursor: pointer; font-size: 0.85rem; transition: all 0.12s ease;
}
.btn-ghost:hover { border-color: var(--orange); color: var(--orange-deep); }
.btn-ghost:disabled { opacity: 0.55; cursor: default; }

.callout { border: 1px solid var(--border); background: var(--card); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1rem 0; }
.callout.error { border-color: #E0B4A0; background: #FCF1EB; }
.admin-panel {
    border: 1px solid rgba(232, 132, 90, 0.4); background: rgba(232, 132, 90, 0.06);
    border-radius: var(--radius); padding: 0.85rem 1.15rem; margin: 1.25rem 0;
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.85rem;
}

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 1rem; margin: 1.75rem 0; }
.stat-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.2rem 1.3rem; transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(27, 40, 56, 0.06); }
.stat-num { font-family: var(--font-mono); font-size: 2rem; font-weight: 600; line-height: 1; color: var(--navy); }
.stat-label { color: var(--fg-muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.55rem; }
.stat-card.accent { border-color: rgba(232, 132, 90, 0.4); }
.stat-card.accent .stat-num { color: var(--orange-deep); }

.quick-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 1.25rem; }
.quick-links a { font-weight: 500; }

/* Framework filter */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin: 1.5rem 0; }
.filter-label { color: var(--fg-muted); font-size: 0.72rem; margin-right: 0.35rem; text-transform: uppercase; letter-spacing: 0.08em; }
.filter-btn {
    background: var(--card); color: var(--fg-muted); border: 1px solid var(--border);
    border-radius: 999px; padding: 0.35rem 0.9rem; cursor: pointer; font-size: 0.85rem; font-family: inherit;
    transition: all 0.12s ease;
}
.filter-btn:hover { border-color: var(--border-strong); color: var(--navy); }
.filter-btn.active { background: var(--orange); color: #241009; border-color: var(--orange); font-weight: 600; }

/* Domain groups + tables */
.domain-group { margin: 2rem 0; }
.domain-group h2 {
    font-size: 1.15rem; font-weight: 700; padding-bottom: 0.5rem; margin-bottom: 0;
    border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 0.6rem;
}
.domain-count {
    font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500;
    background: var(--warm); color: var(--fg-muted); border-radius: 999px; padding: 0.1rem 0.55rem;
}

.table-scroll {
    overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius);
    margin-top: 0.85rem; background: var(--card);
}
table.register { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
table.register th, table.register td { text-align: left; padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--border); vertical-align: top; }
table.register tbody tr:last-child td { border-bottom: none; }
table.register thead th {
    color: var(--fg-muted); font-weight: 600; white-space: nowrap; text-transform: uppercase;
    letter-spacing: 0.06em; font-size: 0.68rem; background: var(--sand);
}
table.register tbody tr:hover { background: var(--cream); }
td.statement { min-width: 18rem; max-width: 32rem; }

.mono { font-family: var(--font-mono); white-space: nowrap; color: var(--deep); font-size: 0.82rem; }
.mono-sm { font-family: var(--font-mono); font-size: 0.78rem; color: var(--fg-dim); }

/* Framework mapping chips */
.map-chip {
    display: inline-flex; align-items: center; gap: 0.3rem; font-family: var(--font-mono);
    font-size: 0.72rem; background: var(--sand); border: 1px solid var(--border);
    border-radius: 0.4rem; padding: 0.1rem 0.45rem; margin: 0.1rem 0.25rem 0.1rem 0; color: var(--deep);
}
.map-fw { font-weight: 600; color: var(--blue); }

/* Status pills - semantic, distinct from the orange accent */
.pill { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.pill-implemented { background: rgba(39, 174, 96, 0.12); color: #1E874B; border-color: rgba(39, 174, 96, 0.35); }
.pill-partial     { background: rgba(212, 160, 63, 0.14); color: #A9781F; border-color: rgba(212, 160, 63, 0.4); }
.pill-planned     { background: rgba(100, 116, 139, 0.12); color: #556173; border-color: rgba(100, 116, 139, 0.32); }
.pill-unknown     { background: var(--warm); color: var(--fg-muted); border-color: var(--border); }

/* Sign-off state badges */
.state-badge { display: inline-block; padding: 0.12rem 0.55rem; border-radius: 0.4rem; font-size: 0.72rem; font-weight: 600; border: 1px solid transparent; }
.state-approved { background: rgba(39, 174, 96, 0.12); color: #1E874B; border-color: rgba(39, 174, 96, 0.35); }
.state-review   { background: rgba(0, 119, 182, 0.10); color: #0369A1; border-color: rgba(0, 119, 182, 0.3); }
.state-rejected { background: rgba(196, 87, 46, 0.10); color: var(--orange-deep); border-color: rgba(196, 87, 46, 0.3); }
.state-draft    { background: var(--warm); color: var(--fg-muted); border-color: var(--border); }
.signoff-meta { font-family: var(--font-mono); font-size: 0.7rem; color: var(--fg-dim); margin-top: 0.3rem; }

/* Attestation editor row */
.attest-row td { background: var(--sand); }
.attest { display: flex; flex-direction: column; gap: 0.75rem; padding: 0.35rem 0.25rem; }
.attest__title { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; }
.attest__fields { display: flex; flex-wrap: wrap; gap: 0.85rem; }
.attest__fields label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.72rem; font-weight: 600; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.attest__fields.grow, .attest__fields label.grow { flex: 1; min-width: 14rem; }
.attest__fields select, .attest__fields input {
    font-family: var(--font-sans); font-size: 0.9rem; font-weight: 400; text-transform: none; letter-spacing: 0;
    color: var(--navy); background: var(--card); border: 1px solid var(--border-strong);
    border-radius: 0.45rem; padding: 0.4rem 0.55rem; min-width: 10rem;
}
.attest__fields input { width: 100%; }
.attest__fields select:focus, .attest__fields input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232, 132, 90, 0.18); }
.attest__actions { display: flex; gap: 0.6rem; align-items: center; }

/* Progress bars */
.bar { display: inline-block; width: 6.5rem; height: 0.5rem; background: var(--warm); border-radius: 999px; overflow: hidden; vertical-align: middle; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--orange), var(--orange-hover)); }
.bar-label { font-family: var(--font-mono); font-size: 0.8rem; margin-left: 0.5rem; color: var(--deep); }
