:root {
    --bg: #f4f3ef;
    --surface: #ffffff;
    --surface-soft: #ecebe6;
    --text: #111111;
    --muted: #565656;
    --border: #202020;
    --focus: #005fcc;
    --success: #0a6b3b;
    --warning: #8a4b00;
    --danger: #a61b1b;
    --radius: 20px;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 10% 0%, rgba(199, 233, 255, .75), transparent 28rem),
        radial-gradient(circle at 100% 18%, rgba(255, 220, 188, .65), transparent 28rem),
        var(--bg);
    font-family: "e-Ukraine", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 18px;
    line-height: 1.55;
}

button, input, select, textarea { font: inherit; }

a { color: #111; text-decoration-thickness: .12em; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .2em; }

img, svg { max-width: 100%; }

.container { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }

.skip-link {
    position: fixed;
    left: 16px;
    top: 12px;
    z-index: 9999;
    transform: translateY(-180%);
    background: #fff;
    color: #000;
    border: 3px solid #000;
    border-radius: 8px;
    padding: 12px 16px;
    font-weight: 700;
}
.skip-link:focus { transform: translateY(0); }

:focus-visible {
    outline: 4px solid var(--focus);
    outline-offset: 4px;
}

.site-header {
    background: rgba(255,255,255,.9);
    border-bottom: 1px solid rgba(0,0,0,.16);
    backdrop-filter: blur(12px);
}

.header-inner {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    font-weight: 800;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #111;
    color: #fff;
    font-size: 1.25rem;
}

.nav-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-list a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 4px;
    font-weight: 650;
}

.admin-userbar {
    background: #111;
    color: #fff;
    padding: 9px 0;
    font-size: .92rem;
}

.main-content { padding-block: 48px 72px; }

.hero {
    padding: clamp(28px, 6vw, 72px);
    border: 2px solid #111;
    border-radius: 32px;
    background: linear-gradient(135deg, rgba(210,239,255,.94), rgba(255,226,202,.94) 52%, rgba(224,255,222,.94));
    box-shadow: var(--shadow);
    margin-bottom: 42px;
}

.eyebrow {
    margin: 0 0 8px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-size: .82rem;
}

h1, h2, h3 { line-height: 1.16; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 6vw, 4.8rem); margin: 0 0 20px; letter-spacing: -.045em; }
h2 { font-size: clamp(1.65rem, 3vw, 2.55rem); margin: 0 0 18px; }
h3 { font-size: 1.3rem; margin: 0 0 10px; }

.lead { max-width: 760px; font-size: clamp(1.1rem, 2vw, 1.35rem); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow);
}

.card-link { display: flex; flex-direction: column; min-height: 100%; }
.card-link .button { margin-top: auto; align-self: flex-start; }

.meta-list { margin: 16px 0 22px; padding-left: 1.25rem; }
.meta-list li { margin-block: 8px; }

.button, button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 48px;
    padding: 12px 22px;
    border: 2px solid #111;
    border-radius: 12px;
    background: #111;
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.button:hover { background: #303030; }
.button-secondary { background: #fff; color: #111; }
.button-secondary:hover { background: #ececec; }
.button-danger { background: #8d1717; border-color: #8d1717; }
.button-small { min-height: 44px; padding: 9px 14px; font-size: .92rem; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.panel {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(22px, 4vw, 38px);
    box-shadow: var(--shadow);
}

.form-grid { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-group { display: grid; gap: 8px; margin-bottom: 20px; }
.form-group.full { grid-column: 1 / -1; }
label, legend { font-weight: 780; }
.help { margin: 0; color: var(--muted); font-size: .92rem; }
.required::after { content: " *"; color: var(--danger); }

input:not([type]), input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"], input[type="password"], input[type="search"], textarea, select {
    width: 100%;
    min-height: 58px;
    border: 2px solid #5b5b5b;
    border-radius: 14px;
    padding: 13px 16px;
    background: #fafaf8;
    color: #111;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

input:not([type]):hover, input[type="text"]:hover, input[type="email"]:hover, input[type="tel"]:hover, input[type="date"]:hover, input[type="number"]:hover, input[type="password"]:hover, input[type="search"]:hover, textarea:hover, select:hover {
    border-color: #111;
}

input:not([type]):focus, input[type="text"]:focus, input[type="email"]:focus, input[type="tel"]:focus, input[type="date"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="search"]:focus, textarea:focus, select:focus {
    background: #fff;
    border-color: #111;
    box-shadow: 0 0 0 4px rgba(0,95,204,.16);
}

input::placeholder, textarea::placeholder { color: #696969; opacity: 1; }
textarea { min-height: 150px; resize: vertical; }
input[type="file"] { width: 100%; min-height: 48px; padding: 10px; border: 2px dashed #555; border-radius: 10px; background: #fff; }

fieldset {
    border: 2px solid #555;
    border-radius: 14px;
    padding: 18px;
    margin: 0 0 22px;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 44px;
    padding: 8px 0;
}
.check-row input { width: 22px; height: 22px; margin-top: 2px; flex: 0 0 auto; }

.alert {
    border: 2px solid #111;
    border-left-width: 10px;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 24px;
    background: #fff;
}
.alert-success { border-left-color: var(--success); }
.alert-warning { border-left-color: var(--warning); }
.alert-error { border-left-color: var(--danger); }
.alert-info { border-left-color: var(--focus); }

.steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 0;
    margin: 0 0 30px;
}
.steps li {
    border: 2px solid #777;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
    font-size: .9rem;
    font-weight: 700;
}
.steps li.current { border-color: #111; background: #111; color: #fff; }
.steps li.done { border-color: var(--success); }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 6px 10px;
    border: 2px solid #111;
    border-radius: 999px;
    background: #fff;
    font-weight: 750;
    font-size: .9rem;
}

.table-wrap { overflow-x: auto; border: 2px solid #111; border-radius: 14px; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; vertical-align: top; padding: 14px; border-bottom: 1px solid #aaa; }
th { background: #e8e7e2; font-weight: 800; }
tr:last-child td { border-bottom: 0; }

.definition-list { display: grid; grid-template-columns: minmax(160px, 240px) 1fr; gap: 10px 22px; }
.definition-list dt { font-weight: 800; }
.definition-list dd { margin: 0; overflow-wrap: anywhere; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-left: 4px solid #111; padding: 0 0 22px 18px; }
.timeline li:last-child { padding-bottom: 0; }

.code-box {
    display: inline-block;
    padding: 10px 14px;
    border: 2px dashed #111;
    border-radius: 10px;
    background: #fff;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-weight: 800;
    letter-spacing: .08em;
}

.site-footer { border-top: 1px solid #999; background: rgba(255,255,255,.72); }
.footer-inner { padding-block: 28px; font-size: .9rem; color: #333; }

.print-sheet {
    background: #fff;
    color: #000;
    max-width: 820px;
    margin: 0 auto;
    padding: 48px;
    border: 1px solid #777;
    box-shadow: var(--shadow);
}
.print-sheet h1 { font-size: 2rem; text-align: center; }
.statement-recipient { max-width: 360px; margin-left: auto; }
.statement-signature { margin-top: 56px; display: flex; justify-content: space-between; gap: 24px; }

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 850px) {
    .header-inner { align-items: flex-start; flex-direction: column; padding-block: 14px; }
    .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
    .steps { grid-template-columns: 1fr 1fr; }
    .definition-list { grid-template-columns: 1fr; gap: 2px; }
    .definition-list dd { margin-bottom: 14px; }
}

@media (max-width: 520px) {
    body { font-size: 17px; }
    .container { width: min(100% - 20px, 1180px); }
    .hero, .panel, .card { border-radius: 16px; padding: 20px; }
    .steps { grid-template-columns: 1fr; }
    .button, button.button { width: 100%; }
    .print-sheet { padding: 22px; }
    .statement-signature { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

@media print {
    body { background: #fff; font-size: 12pt; }
    .site-header, .site-footer, .admin-userbar, .no-print, .alert { display: none !important; }
    .main-content, .container { width: 100%; max-width: none; margin: 0; padding: 0; }
    .print-sheet { border: 0; box-shadow: none; max-width: none; padding: 12mm; }
    a { text-decoration: none; }
}


/* Application form 0.1.2 */
.page-heading {
    font-size: clamp(2rem, 5vw, 3.8rem);
}

.application-panel {
    overflow: hidden;
}

.form-section {
    margin-top: 28px;
    padding: clamp(20px, 3.5vw, 32px);
    border: 1px solid #b8b8b2;
    border-radius: 20px;
    background: #f7f7f3;
}

.form-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.form-section-heading h2 {
    margin: 1px 0 4px;
    font-size: clamp(1.35rem, 2.5vw, 1.8rem);
}

.form-section-heading p {
    margin: 0;
    color: var(--muted);
}

.section-number {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border: 2px solid #111;
    border-radius: 50%;
    background: #111;
    color: #fff;
    font-weight: 800;
}

.contact-fieldset {
    border: 0;
    padding: 0;
    margin: 0 0 22px;
}

.contact-fieldset legend {
    margin-bottom: 12px;
}

.contact-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.contact-option {
    position: relative;
    display: grid;
    grid-template-columns: 28px 42px 1fr;
    align-items: start;
    gap: 12px;
    min-height: 148px;
    padding: 20px;
    border: 2px solid #686868;
    border-radius: 18px;
    background: #fff;
    cursor: pointer;
    font-weight: 400;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.contact-option:hover:not(.is-disabled) {
    border-color: #111;
    transform: translateY(-2px);
}

.contact-option:has(input:checked) {
    border-color: #111;
    background: #edf7ff;
    box-shadow: 0 0 0 3px rgba(0,95,204,.14);
}

.contact-option input[type="radio"] {
    width: 24px;
    height: 24px;
    margin: 3px 0 0;
    accent-color: #111;
}

.contact-option-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #111;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 800;
}

.contact-option-content {
    display: grid;
    gap: 7px;
}

.contact-option-content strong {
    font-size: 1.05rem;
    line-height: 1.3;
}

.contact-option-content > span {
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.45;
}

.contact-option.is-disabled {
    cursor: not-allowed;
    color: #5f5f5f;
    background: #ecece8;
    border-color: #aaa;
}

.contact-option.is-disabled .contact-option-icon {
    background: #777;
}

.contact-option-control {
    width: 24px;
    height: 24px;
    margin-top: 3px;
    border: 2px solid #888;
    border-radius: 50%;
    background: #ddd;
}

.coming-soon {
    display: inline-flex;
    margin-left: 5px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #333;
    color: #fff;
    font-size: .7rem;
    vertical-align: middle;
}

.contact-details-grid {
    margin-top: 8px;
}

.contact-detail {
    padding: 16px;
    border: 2px solid transparent;
    border-radius: 16px;
    background: rgba(255,255,255,.58);
    transition: border-color .15s ease, background-color .15s ease;
}

.contact-detail.is-preferred {
    border-color: #111;
    background: #fff;
}

.alert-soft {
    border-width: 1px;
    border-left-width: 6px;
    border-left-color: #777;
    background: #f8f8f6;
    color: #333;
}

.confirmation-fieldset {
    margin-top: 28px;
    background: #fff;
}

.form-actions {
    padding-top: 4px;
}

@media (max-width: 900px) {
    .contact-options { grid-template-columns: 1fr; }
    .contact-option { min-height: auto; }
}

@media (max-width: 520px) {
    .form-section { padding: 18px; border-radius: 16px; }
    .form-section-heading { gap: 12px; }
    .section-number { width: 38px; height: 38px; }
    .contact-option { grid-template-columns: 26px 36px 1fr; padding: 16px; }
    .contact-option-icon { width: 36px; height: 36px; }
}

.optional-label {
    display: inline-block;
    margin-left: .35rem;
    font-size: .82em;
    font-weight: 500;
    color: #4b5563;
}
.muted {
    color: #5f6670;
}

/* Workflow and PDF download 0.1.4 */
.table-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.table-actions form,
.inline-form {
    margin: 0;
}

.assignment-panel {
    border-left: 10px solid #111;
}

.assignment-form {
    max-width: 720px;
}

.button:disabled,
button.button:disabled {
    cursor: progress;
    opacity: .65;
}
