*, *::before, *::after { box-sizing: border-box; }

/* ============ Design tokens ============ */
:root {
    --wf-ink:           #1a1a2e;
    --wf-primary:       #1d4ed8;
    --wf-primary-hover: #1e40af;
    --wf-muted:         #6b7280;
    --wf-border:        #d1d5db;
    --wf-danger:        #b91c1c;
    --wf-success:       #065f46;
    --wf-warning:       #92400e;
    --wf-bg:            #f0f4f8;
    --wf-focus:         #2563eb;
    --wf-radius:        6px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--wf-ink);
    background: #f5f5f5;
    margin: 0;
    padding: 0;
}

/* Klávesnicový focus — viditelný na všech interaktivních prvcích */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--wf-focus);
    outline-offset: 2px;
}

/* Sign pages layout */
.sign-layout {
    background: var(--wf-bg);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
}

.sign-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,.1);
    padding: 2rem;
    width: 100%;
    max-width: 680px;
}

.sign-container h1 {
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--wf-ink);
}

@media (max-width: 480px) {
    .sign-layout    { padding: 1rem 0.5rem; }
    .sign-container { padding: 1.25rem; }
}

/* ============ Krokový indikátor podpisového procesu ============ */
.sign-steps {
    display: flex;
    gap: 0.25rem;
    margin: 0 0 1.5rem;
    padding: 0;
    list-style: none;
    counter-reset: step;
}
.sign-steps li {
    flex: 1;
    text-align: center;
    font-size: 0.8rem;
    color: var(--wf-muted);
    position: relative;
    padding-top: 2rem;
}
.sign-steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1.75rem;
    height: 1.75rem;
    line-height: 1.75rem;
    border-radius: 50%;
    background: #e5e7eb;
    color: var(--wf-muted);
    font-weight: 600;
}
.sign-steps li.active { color: var(--wf-ink); font-weight: 600; }
.sign-steps li.active::before { background: var(--wf-primary); color: #fff; }
.sign-steps li.done::before   { background: var(--wf-success); color: #fff; content: "\2713"; }
@media (max-width: 480px) {
    .sign-steps li { font-size: 0; }               /* na mobilu jen čísla… */
    .sign-steps li.active { font-size: 0.8rem; }   /* …a popisek aktivního kroku */
}

/* Login page */
.login-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,.1);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    margin: 4rem auto;
}

.login-container h1 { margin-top: 0; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: .3rem; }
.form-control, input[type="text"], input[type="email"],
input[type="password"], input[type="date"], input[type="tel"],
input[type="number"], select, textarea {
    display: block;
    width: 100%;
    padding: .5rem .75rem;
    font-size: 1rem;
    border: 1px solid var(--wf-border);
    border-radius: var(--wf-radius);
    background: #fff;
    color: var(--wf-ink);
}
.form-control:focus, input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--wf-focus);
    outline-offset: 0;
    border-color: var(--wf-focus);
}
input[readonly], .form-control[readonly] { background: #f3f4f6; color: var(--wf-muted); }

/* Dvousloupcová řada polí — na mobilu pod sebe */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
}
@media (max-width: 560px) {
    .form-row { grid-template-columns: 1fr; }
}

/* Nápověda pod polem */
.form-text { display: block; font-size: .875rem; color: var(--wf-muted); margin-top: .25rem; }

fieldset {
    border: none;
    padding: 0;
    margin: 0 0 1.5rem;
}
legend {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0;
    margin-bottom: .75rem;
    border-bottom: 1px solid #e5e7eb;
    width: 100%;
    padding-bottom: .35rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: .55rem 1.25rem;
    min-height: 44px;               /* touch target */
    font-size: 1rem;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: var(--wf-radius);
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    line-height: 1.4;
}
.btn-primary  { background: var(--wf-primary); color: #fff; }
.btn-primary:hover { background: var(--wf-primary-hover); }
.btn-secondary { background: #6c757d; color: #fff; }
.btn-secondary:hover { background: #5a6268; }
.btn-outline-primary {
    background: #fff; color: var(--wf-primary); border-color: var(--wf-primary);
}
.btn-outline-primary:hover { background: var(--wf-primary); color: #fff; }
.btn-outline-secondary {
    background: #fff; color: #495057; border-color: #adb5bd;
}
.btn-outline-secondary:hover { background: #f3f4f6; }
.btn-link { background: none; border: none; color: var(--wf-primary); text-decoration: underline; padding: 0; min-height: 0; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-sm { padding: .3rem .75rem; font-size: .875rem; min-height: 36px; }
.btn-block { display: block; width: 100%; }

/* Alerts */
.alert { padding: .75rem 1rem; border-radius: var(--wf-radius); margin-bottom: 1rem; }
.alert p:first-child { margin-top: 0; }
.alert p:last-child  { margin-bottom: 0; }
.alert-danger  { background: #fde8e8; border: 1px solid #f5a5a5; color: var(--wf-danger); }
.alert-warning { background: #fff7e6; border: 1px solid #fbbf24; color: var(--wf-warning); }
.alert-success { background: #e6f9f0; border: 1px solid #6ee7b7; color: var(--wf-success); }
.alert-info    { background: #e6f0fd; border: 1px solid #93c5fd; color: #1e40af; }

/* Error summary (asp-validation-summary renderuje <ul>) */
.validation-summary-errors ul { margin: .25rem 0 0; padding-left: 1.25rem; }
.validation-summary-errors li { margin-bottom: .15rem; }

/* Signature area */
#signature-area {
    margin: 1rem 0;
}

#signature-canvas {
    display: block;
    max-width: 100%;
    border: 2px dashed #9ca3af;
    cursor: crosshair;
    touch-action: none;
    background: #fff;
    border-radius: var(--wf-radius);
}

.canvas-hint { font-size: .875rem; color: var(--wf-muted); margin: .25rem 0 .5rem; }
.canvas-actions { margin-top: .5rem; }

/* Consent block */
.consent-block { margin: 1rem 0; padding: .75rem; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: var(--wf-radius); }
.consent-block label { display: flex; gap: .6rem; align-items: flex-start; font-weight: normal; cursor: pointer; }
.consent-block input[type="checkbox"] { margin-top: .2rem; flex-shrink: 0; width: 1.25rem; height: 1.25rem; }

/* Form actions */
.form-actions { display: flex; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }
@media (max-width: 480px) {
    .form-actions { flex-direction: column-reverse; }  /* primární akce nahoře */
    .form-actions .btn { width: 100%; }
}

/* Stavové ikony (Confirmation / Expired) */
.confirmation-icon, .expired-icon {
    width: 3.5rem;
    height: 3.5rem;
    line-height: 3.5rem;
    border-radius: 50%;
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
}
.confirmation-icon { background: #e6f9f0; color: var(--wf-success); }
.expired-icon      { background: #fff7e6; color: var(--wf-warning); }

/* Utilities (Bootstrap-kompatibilní názvy používané v public stránkách) */
.mb-2 { margin-bottom: .5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.d-flex { display: flex; }
.gap-2  { gap: .5rem; }
.align-items-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.small { font-size: .875rem; }
.text-warning { color: #b45309; }
.text-danger  { color: var(--wf-danger); }
.text-success { color: var(--wf-success); }
.text-muted   { color: var(--wf-muted); }
.field-validation-error { color: var(--wf-danger); font-size: .875rem; display: block; margin-top: .25rem; }
.input-validation-error { border-color: var(--wf-danger) !important; }

/* GDPR / Privacy notice */
.privacy-notice { font-size: .9rem; line-height: 1.6; }
.privacy-notice h2 { font-size: 1.1rem; margin-top: 1.5rem; }
