/* ==========================================================================
   Evico design system
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--ev-font);
    font-size: 16px;
    line-height: 1.55;
    color: var(--ev-text);
    background: var(--ev-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    /* The footer of a short public page sits at the bottom of the screen. */
    display: flex; flex-direction: column; min-height: 100vh;
}

main { flex: 1 0 auto; width: 100%; min-width: 0; }

h1, h2, h3, h4 {
    font-family: var(--ev-font-display);
    line-height: 1.3;
    margin: 0 0 .5em;
    color: var(--ev-text);
}

h1 { font-size: 28px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; line-height: 1.4; font-weight: 700; }

p { margin: 0 0 1em; }
a { color: var(--ev-primary-ink); text-decoration: none; }
a:hover { color: var(--ev-primary-hover); }

:focus-visible { outline: none; box-shadow: var(--ev-ring); border-radius: 8px; }

/* ---------- Header: one per page, one area's menu, never a primary button ---------- */

.site-header { position: sticky; top: 0; z-index: 50; background: var(--ev-surface); border-bottom: 1px solid var(--ev-border); }
.site-header-in { display: flex; align-items: center; gap: 32px; max-width: var(--ev-page-width); min-height: var(--ev-header-height); margin: 0 auto; padding: 0 var(--ev-page-gutter); }
.site-nav { display: flex; gap: 4px; flex: 1 1 auto; min-width: 0; align-items: center; }
.site-header-tools { display: flex; gap: 8px; align-items: center; min-width: 0; margin-left: auto; }
.nav-link { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 12px; font-size: 15px; font-weight: 600; color: var(--ev-text-2); white-space: nowrap; }
.nav-link:hover, .nav-link.on { background: var(--ev-surface-2); color: var(--ev-text); }
.nav-sign-in { font-size: 14px; color: var(--ev-text); }
.nav-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--ev-pill); background: var(--ev-primary-soft); color: var(--ev-primary-ink); font-size: 12px; font-weight: 700; }

/* The visitor's links of a page without a circuit, until its script looked. */
.site-header-in > [hidden] { display: none; }

/* A failed page: the code for the support, marked whole by one press. */
.error-code { max-width: 720px; }
.error-code p { margin: 0 0 16px; color: var(--ev-text-2); }
.error-code dl { display: grid; gap: 4px; margin: 0; }
.error-code dd { margin: 0; }
.error-code code { font-size: 16px; user-select: all; overflow-wrap: anywhere; }

/* What the connection says stays in sight under the header, and under the header's own menus. */
.reconnect-banner { position: sticky; top: calc(var(--ev-header-height) + 1px); z-index: 45; }

/* A narrow screen: the menu takes a line of its own and scrolls inside it; the header scrolls away with the page. */
@media (max-width: 860px) {
    .site-header { position: static; }
    .reconnect-banner { top: 0; }
    .site-header-in { flex-wrap: wrap; padding: 12px 16px; gap: 8px 12px; }
    .site-nav { order: 3; flex: 1 0 100%; overflow-x: auto; scrollbar-width: none; }
    .site-nav::-webkit-scrollbar { display: none; }
    /* The bell and the account (or the way in) at the right of the logo line; the company at its left, after the logo. */
    .site-header-tools { flex: 1 1 auto; justify-content: flex-end; max-width: 100%; }
    .site-header-tools > .company-switcher { margin-right: auto; }
}

/* A phone: the company, when there is one, takes the line between the logo and the menu, as wide as it. */
@media (max-width: 640px) {
    .site-header-tools:has(> .company-switcher) { display: contents; }
    .site-header .site-header-tools > .company-switcher { order: 2; flex: 1 0 100%; max-width: 100%; margin-right: 0; }
    .site-header .site-header-tools > .company-switcher.single { max-width: 100%; }
    .site-header-tools > .company-switcher + * { margin-left: auto; }
    .site-header-tools > .company-switcher .company-switcher-toggle { width: 100%; }
    .site-header-tools > .company-switcher .company-switcher-caret { margin-left: auto; }
}

/* ---------- Landing ---------- */

.landing { display: grid; grid-template-columns: minmax(0, 1fr); gap: 64px; }
.hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 48px; align-items: center; padding: clamp(24px, 4vw, 48px); border-radius: var(--ev-radius-lg); background: var(--ev-ink); color: var(--ev-on-ink); }
.hero > div { min-width: 0; }
.hero .eyebrow { color: var(--ev-accent); }
.hero h1 { margin: 12px 0 0; color: inherit; }
.hero-lead { margin: 16px 0 0; max-width: 480px; color: var(--ev-surface-3); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-actions .btn-ghost { --btn-fg: var(--ev-on-ink); --btn-border: var(--ev-muted); padding: 0 22px; }
.hero-actions .btn-ghost:hover { background: transparent; border-color: var(--ev-on-ink); }
.hero-existing { margin: 20px 0 0; color: var(--ev-surface-3); }
.hero-existing a { color: var(--ev-on-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 12px 16px; margin: 28px 0 0; padding: 20px 0 0; list-style: none; border-top: 1px solid var(--ev-text-2); color: var(--ev-surface-3); }
.hero-proof li { display: flex; gap: 8px; align-items: center; }
.hero-proof svg { flex: none; color: var(--ev-accent); }
.hero-sample { padding: 24px; border-radius: var(--ev-radius-lg); background: var(--ev-surface); color: var(--ev-text); }
.hero-sample-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.hero-sample-count { margin: 4px 0 12px; }
.progress .hero-sample-progress { width: 75%; }
.hero-sample-list { margin: 16px 0 0; padding: 0; list-style: none; }
.hero-sample-list li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--ev-border); }
.hero-sample-text { flex: 1 1 auto; min-width: 0; }
.hero-sample-text strong { display: block; font-size: 14px; line-height: 1.4; }
.hero-sample .callout { margin-top: 12px; }
.hero-sample .callout .ico { margin-top: 0; }
@media (prefers-color-scheme: dark) {
    /* The band is light there: the orange of the design would be too pale on it. */
    .hero .eyebrow, .hero-proof svg { color: color-mix(in srgb, var(--ev-accent) 45%, var(--ev-on-ink)); }
}

.landing-head { margin-bottom: 24px; }
.landing-head h2 { margin: 6px 0 0; }
.landing-head p { margin: 6px 0 0; max-width: 640px; color: var(--ev-text-2); }
.landing-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 24px; margin: 0; padding: 0; list-style: none; counter-reset: landing-step; }
.landing-steps li { counter-increment: landing-step; }
.landing-steps li::before { content: counter(landing-step); width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--ev-ink); color: var(--ev-on-ink); font-weight: 800; }
.landing-steps h3 { margin: 16px 0 8px; }
.landing-steps p, .plan p, .landing-trust p, .faq p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ev-text-2); }
.plan { display: flex; flex-direction: column; gap: 16px; }
.plan h3 { margin: 0 0 4px; font-size: 20px; line-height: 1.3; }
.plan .point-list { margin-bottom: 8px; }
.plan .btn { margin-top: auto; }
.landing-trust { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 32px; margin: 0; padding: 0; list-style: none; }
.landing-trust li { display: flex; gap: 16px; align-items: flex-start; }
.landing-trust h3 { margin: 0 0 4px; }
.faq { padding: 0; overflow: hidden; }
.faq details { padding: 14px 24px; }
.faq details + details { border-top: 1px solid var(--ev-border); }
.faq summary { min-height: 44px; font-weight: 700; line-height: 44px; cursor: pointer; }
.faq p { max-width: 720px; padding-bottom: 8px; }
.landing-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding: 32px; border-radius: var(--ev-radius-lg); background: var(--ev-primary-soft); }
.landing-cta > div { flex: 1 1 320px; }
.landing-cta h2 { margin: 0 0 4px; }
.landing-cta p { margin: 0; color: var(--ev-text-2); }
/* A link of the header to a section stops below the sticky header. */
.landing section[id] { scroll-margin-top: calc(var(--ev-header-height) + 24px); }

.site-footer { border-top: 1px solid var(--ev-border); background: var(--ev-surface); }
.site-footer-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; max-width: var(--ev-page-width); margin: 0 auto; padding: 24px var(--ev-page-gutter); font-size: 13px; line-height: 1.45; color: var(--ev-muted); }

/* ---------- Start (legal form choice) ---------- */

.choice {
    text-align: left; font: inherit; color: inherit; cursor: pointer;
    padding: 24px; border-radius: var(--ev-radius-lg);
    background: var(--ev-surface); border: 1px solid var(--ev-border); box-shadow: var(--ev-shadow-sm);
    transition: border-color .2s ease;
}
.choice:hover { border-color: var(--ev-primary); }

/* ---------- Wizard ---------- */

.wizard { display: grid; grid-template-columns: 192px minmax(0, 1fr) 272px; gap: 24px; align-items: start; }
.wizard-rail { position: sticky; top: calc(var(--ev-header-height) + 24px); }
/* A flex column, not a grid: what sticks inside it may travel the whole form. */
.wizard-form { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
/* The step's action zone (buttons and, under them, what stops the step or a refused autosave) stays in view at the bottom of the
   screen while the step is longer than it, on the page's own background so it reads in both themes. */
.step-action-zone { position: sticky; bottom: 0; z-index: 5; margin: -16px -4px 0; padding: 16px 4px; background: var(--ev-bg); }
.step-action-errors { max-height: 40vh; overflow-y: auto; }
@media (max-width: 1040px) {
    .wizard { grid-template-columns: minmax(0, 1fr); }
    .wizard-rail { position: static; }
}
/* On a phone the buttons stand full width at the end of the step; only what went wrong stays in view. */
@media (max-width: 640px) {
    .step-action-zone { display: contents; }
    .step-action-errors { position: sticky; bottom: 0; z-index: 5; margin-top: -24px; background: var(--ev-bg); }
}

/* Account pages */
.auth-form { display: grid; gap: 20px; }
.auth-foot { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--ev-border); font-size: 14px; line-height: 1.5; color: var(--ev-text-2); }
.check { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; font-size: 14px; line-height: 1.5; font-weight: 400; color: var(--ev-text); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ev-primary); flex: none; }
.validation-message { display: block; }

.checklist .check-item { align-items: flex-start; }
.check-item .tick { flex: 1 1 320px; padding: 0; }
.check-item strong { display: block; font-size: 16px; }
.check-item .text { color: var(--ev-text-2); }
.check-item.done strong { color: var(--ev-muted); text-decoration: line-through; }
.check-item > .action-error { flex: 1 0 100%; margin-top: 0; }
.list-head { margin-bottom: 16px; }
.registered-on { margin-top: 20px; }

/* ---------- Boot screen (App.razor): shown until the circuit renders the layout ---------- */

.boot-screen .loading-screen { min-height: 100vh; }
body:has(> main) > .boot-screen { display: none; }

/* ---------- Blazor framework UI ---------- */

#blazor-error-ui {
    color-scheme: light only;
    background: #fff7d6; border-top: 1px solid #f0d77a;
    bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    display: none; left: 0; padding: .7rem 1.25rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
.blazor-error-boundary { background: var(--ev-danger); padding: 1rem; color: white; border-radius: 12px; }
.blazor-error-boundary::after { content: "A apărut o eroare."; }

/* Contract signing */
.sign-panel { position: sticky; top: calc(var(--ev-header-height) + 16px); }
.signer-list { display: grid; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.signer-list button { display: flex; gap: 12px; align-items: center; width: 100%; min-height: 56px; padding: 8px 12px; border: 1px solid var(--ev-border); border-radius: var(--ev-radius); background: var(--ev-surface); font: 400 14px/1.4 var(--ev-font); color: var(--ev-text); text-align: left; cursor: pointer; }
.signer-list li.on button { border-color: var(--ev-ink); box-shadow: inset 0 0 0 1px var(--ev-ink); }
.signer-list .text { display: grid; flex: 1 1 auto; min-width: 0; }
.signer-list strong { font-size: 16px; }
.signer-list .signed { display: inline-grid; color: var(--ev-success-ink); }
.pad-block { display: grid; gap: 12px; }
.pad-block > .callout, .pad-block > .action-error, .pad-block > .required-legend { margin: 0; }
.signature-label { margin: 0; }
.sign-downloads { display: flex; flex-wrap: wrap; gap: 12px; }
.sign-downloads > .action-error { flex: 1 0 100%; margin-top: 0; }
@media (max-width: 960px) { .sign-panel { position: static; } }
/* Invited co-founders sign from a link on their phone (spec 15.7): the page must work at 375 px wide. */
.fits-375 { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 420px) {
    .fits-375 .sign-layout { gap: 24px; }
}

/* ---------- The lawyer's, support's and admin's pages ---------- */

/* Filters above a list: tabs on the left, the search on the right; or a card of fields and their button. */
.staff-tabs { margin-bottom: 24px; }
.staff-toolbar { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.staff-toolbar .field { flex: 0 1 280px; }
.staff-filter { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; margin-bottom: 32px; }
.staff-filter .grow-3 { flex: 2 1 320px; }
.staff-filter .grow-2 { flex: 2 1 220px; }
.staff-filter .grow-1 { flex: 1 1 160px; }
.staff-filter > .action-error { flex: 1 1 100%; margin-top: 0; }

/* Tables: the row's buttons on the right, the person with their initials, the cabinet with its button. */
.staff-nowrap { white-space: nowrap; }
.staff-account { display: flex; gap: 12px; align-items: center; }
.staff-roles { display: grid; gap: 8px; justify-items: start; }
.staff-roles .caption, .staff-cabinet-pick + .caption { margin-top: 4px; }
.staff-cell-note { margin-top: 4px; }
/* Under the row of a table, over its whole width: a question, a refusal or what was done. */
table.t tr:has(+ .staff-row-note) > td { border-bottom: 0; }
table.t .staff-row-note > td { padding-top: 0; }
.staff-row-note .action-error { margin: 0; }
/* In a narrow window the table scrolls sideways; what is said stays in sight, as wide as the box. */
.staff-row-said { position: sticky; left: 20px; width: 100%; max-width: calc(100vw - 2 * var(--ev-page-gutter) - 42px); }
.staff-inline { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.staff-done { margin-top: 12px; }
.staff-cabinet-pick { display: flex; gap: 8px; align-items: center; min-width: 330px; }
.staff-cabinet-pick .field { flex: 1 1 auto; min-width: 0; }
.staff-after-table { margin-top: 16px; }
.staff-plain-link { color: inherit; }
.staff-plain-link:hover { color: var(--ev-primary-ink); }
.staff-link { color: inherit; text-decoration: underline; overflow-wrap: anywhere; }

/* Cards: a title with its badge, facts in two columns, ticks, the guide beside a form. */
.staff-stack { grid-template-columns: minmax(0, 1fr); }
.staff-card-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.staff-card-head .card-title { margin: 0; }
.staff-flush { margin: 0; }
.staff-flush + .form-actions, .staff-under-list { margin-top: 16px; }
.staff-note { margin: 12px 0 0; }
.staff-notice { margin: 0 0 24px; }
.staff-callout { margin-top: 24px; }
.staff-section { margin-top: 32px; }
.staff-legend { margin-top: 16px; }
.staff-legend .required-legend { margin: 0; }
.card .staff-subhead { margin: 0 0 12px; font-size: 14px; line-height: 1.5; font-weight: 600; }
.card > h2.staff-facts-title { margin-bottom: 16px; }
.staff-checks { margin: 0; padding: 0; border: 0; min-width: 0; }
.staff-check { display: flex; gap: 12px; align-items: center; min-height: 48px; font-size: 16px; cursor: pointer; }
.staff-check input { flex: none; width: 20px; height: 20px; accent-color: var(--ev-ink); }
.staff-check.locked { color: var(--ev-muted); cursor: default; }
.staff-check .caption { margin-left: auto; }
.staff-checks + .callout { margin-top: 12px; }
.staff-cabinet-accepts { margin-top: 12px; }
.staff-role-guide { margin-top: 12px; }
.staff-role-guide p, .staff-next { margin: 0; }
.staff-next { display: grid; gap: 8px; margin-top: 12px; padding-left: 20px; color: var(--ev-text-2); }
.staff-move-field { margin-top: 20px; }

/* The lawyer's dossier: the uploads to review, the mandate, the filing, the values for the portal. */
.staff-upload .main { flex: 1 1 320px; }
.staff-upload .meta { overflow-wrap: anywhere; }
.staff-upload-wide { flex: 1 1 100%; min-width: 0; }
.staff-upload-redo { margin-top: 12px; }
.staff-upload-sent { margin-top: 8px; }
.staff-upload-error .action-error { margin-top: 0; }
.card .staff-signatures { margin-top: 24px; }
.staff-mandate { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.staff-mandate .field { flex: 1 1 280px; }
.staff-mandate-saved { display: flex; align-items: center; min-height: 48px; }
.staff-filing { margin-top: 20px; }
.staff-btn-long { white-space: normal; line-height: 1.25; }
.staff-package { min-width: 0; }
.card .staff-portal-group { margin: 20px 0 0; }
.staff-portal { list-style: none; margin: 0; padding: 0; }
.staff-portal li { display: flex; gap: 8px; align-items: center; justify-content: space-between; min-height: 56px; padding: 6px 0; border-bottom: 1px solid var(--ev-border); }
.staff-portal-value { min-width: 0; }
.staff-portal-value .caption { display: block; }
.staff-portal-value .small { font-weight: 600; overflow-wrap: anywhere; }
.staff-copy { flex: none; display: flex; align-items: center; min-height: 44px; }
.staff-copied .saved[hidden] { display: none; }
.staff-portal .iconbtn:has(+ .staff-copied > .saved:not([hidden])) { position: absolute; opacity: 0; pointer-events: none; }

@media (max-width: 640px) {
    .staff-toolbar .field, .staff-filter .field { flex: 1 1 100%; }
    .staff-package { width: 100%; }
}

.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; }
