@font-face {
    font-family: 'Helvetica Neue';
    src: url('../fonts/HelveticaNeue-Thin.otf') format('opentype');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Helvetica Neue';
    src: url('../fonts/HelveticaNeue-ThinItalic.otf') format('opentype');
    font-weight: 100;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Helvetica Neue';
    src: url('../fonts/HelveticaNeue-Light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Helvetica Neue';
    src: url('../fonts/HelveticaNeue-LightItalic.otf') format('opentype');
    font-weight: 300;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Helvetica Neue';
    src: url('../fonts/HelveticaNeue-Roman.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Helvetica Neue';
    src: url('../fonts/HelveticaNeue-Italic.otf') format('opentype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Helvetica Neue';
    src: url('../fonts/HelveticaNeue-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Helvetica Neue';
    src: url('../fonts/HelveticaNeue-MediumItalic.otf') format('opentype');
    font-weight: 500;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Helvetica Neue';
    src: url('../fonts/HelveticaNeue-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Helvetica Neue';
    src: url('../fonts/HelveticaNeue-BoldItalic.otf') format('opentype');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Helvetica Neue';
    src: url('../fonts/HelveticaNeue-Heavy.otf') format('opentype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Helvetica Neue';
    src: url('../fonts/HelveticaNeue-HeavyItalic.otf') format('opentype');
    font-weight: 900;
    font-style: italic;
    font-display: swap;
}

:root {
    --brand-dark: #1f4b99;
    --brand-primary: #6091ba;
    --brand-light: #f0f7fe;
    --text-main: #233242;
    --text-muted: #5a6a7c;
    --line: #c8d7e6;
    --ok: #209f51;
    --warn: #8a2438;
    --card-shadow: 0 5px 5px rgba(16, 55, 102, 0.11);
}

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

html,
body {
    margin: 0;
    padding: 0;
}

body.esa-body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-main);
    background-color: #eef2f6;
    background-image: url("../images/background-full.webp");
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
    background-attachment: scroll;
    background-origin: border-box;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
}

a:hover {
    color: #365d7e;
}

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

.top-strip {
    background: var(--brand-dark);
    color: #fff;
    font-size: 13px;
}

.top-strip-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    min-height: 44px;
}

.top-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.top-strip a {
    color: #eef5ff;
}

.top-strip a:hover {
    color: #fff;
}

.brand-strip {
    background: transparent;
}

.brand-strip-inner {
    display: flex;
    position: relative;
    justify-content: center;
    align-items: center;
    gap: 24px;
    padding: 20px 0 14px;
}

.brand {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    color: var(--text-main);
    text-align: left;
    padding: 8px 0;
    text-decoration: none;
}

.language-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 0;
    top: 50%;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--brand-dark);
    font-size: 22px;
    cursor: pointer;
    box-shadow: none;
    transform: translateY(-50%);
    transition: color .15s ease, transform .15s ease;
}

.language-trigger:hover,
.language-trigger:focus-visible {
    background: transparent;
    color: var(--brand-primary);
    transform: translateY(-50%);
    box-shadow: none;
    outline: none;
}

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

.brand img {
    width: 170px;
    max-width: 34vw;
    height: auto;
    display: block;
}

.brand span {
    font-size: 14pt;
    font-weight: 700;
    line-height: 1.2;
}

.brand small {
    display: block;
    margin-top: 4px;
    font-size: 11pt;
    font-weight: 400;
}

.main-nav {
    background: transparent;
}

.nav-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
    justify-content: center;
}

.nav-link {
    padding: 9px 14px;
    border-radius: 2px;
    font-weight: 600;
    color: white;
    background: rgba(31, 75, 153, 0.84);
    box-shadow: 0 6px 16px rgba(31, 75, 153, 0.14);
}

.nav-link:hover {
    background: rgba(96, 145, 186, 0.94);
    color: white;
}

.nav-link.is-active {
    background: var(--brand-primary);
    color: #fff;
    box-shadow: 0 8px 18px rgba(96, 145, 186, 0.2);
}

.nav-form {
    margin: 0;
}

.nav-link-button {
    border: 0;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(31, 75, 153, 0.84);
    color: #fff;
    font: inherit;
    cursor: pointer;
    display: inline-block;
}

.nav-link-button:hover {
    background: rgba(96, 145, 186, 0.94);
}

.nav-link-button.is-active {
    background: var(--brand-primary);
}

.page-wrap {
    padding: 20px 0 52px;
}

.card {
    background: #fff;
    border: 1px solid var(--line);
    border-top: 3px solid var(--brand-primary);
    box-shadow: var(--card-shadow);
}

.card-body {
    margin: 0 auto;
    padding: 24px;
}

.card-title {
    margin: 0 0 18px;
    font-size: 22pt;
    color: var(--brand-dark);
    font-weight: 600;
}

.card-subtitle {
    margin: -10px 0 20px;
    color: var(--text-muted);
}

.grid {
    display: grid;
    gap: 20px;
}

.grid.two-cols {
    grid-template-columns: 1.1fr 0.9fr;
}

.form-group {
    margin-bottom: 14px;
}

label {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--brand-dark);
    font-weight: 600;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
    font-size: 12pt;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--brand-dark);
    cursor: pointer;
}

.language-modal[hidden] {
    display: none;
}

.language-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.language-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 20, 42, .58);
    backdrop-filter: blur(3px);
}

.language-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, .44);
    border-radius: 0;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 28px 80px rgba(3, 14, 32, .32);
}

.language-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px 12px;
}

.language-modal-head h2 {
    margin: 0;
    color: var(--brand-dark);
    font-size: 22px;
}

.language-modal-close {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(31, 75, 153, .18);
    border-radius: 0;
    background: var(--brand-dark);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.language-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px 22px 22px;
}

.language-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 54px;
    border: 1px solid rgba(31, 75, 153, .16);
    border-radius: 0;
    background: #fff;
    color: var(--text-main);
    padding: 12px 14px;
    text-align: left;
    cursor: pointer;
}

.language-option:hover,
.language-option:focus-visible,
.language-option.is-active {
    border-color: var(--brand-dark);
    background: var(--brand-light);
    outline: none;
}

.language-option span {
    font-weight: 700;
}

.language-option small {
    color: var(--text-muted);
    text-transform: uppercase;
}

.language-modal-open {
    overflow: hidden;
}

input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
    width: 100%;
    border: 1px solid #b9c8d8;
    height: 42px;
    padding: 10px 12px;
    font-size: 13pt;
    color: var(--text-main);
    background: #fff;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(96, 145, 186, 0.2);
}

.form-actions {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn {
    border: 1px solid transparent;
    height: 42px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    font-size: 13pt;
}

.btn-primary {
    background: #1f4b99;
    border-color: #1f4b99;
    color: #fff;
}

.btn-primary:hover {
    background: #4f82ad;
    border-color: #4f82ad;
}

.btn-outline {
    background: #fff;
    border-color: #b9c8d8;
    color: #1f4b99;
}

.btn-outline:hover {
    border-color: var(--brand-primary);
}

.btn:disabled,
.btn[disabled] {
    cursor: not-allowed;
    opacity: 0.55;
}

.alert {
    border: 1px solid;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13pt;
}

.alert-success {
    border-color: rgba(32, 109, 61, 0.35);
    color: var(--ok);
    background: rgba(32, 109, 61, 0.08);
}

.alert-error {
    border-color: rgba(138, 36, 56, 0.35);
    color: var(--warn);
    background: rgba(138, 36, 56, 0.08);
}

.muted {
    color: var(--text-muted);
    font-size: 12pt;
}

.oauth-meta {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.oauth-meta li {
    border: 1px solid #d3dfeb;
    background: #f5f9fd;
    padding: 10px 12px;
}

.kv {
    font-size: 13pt;
    color: var(--text-muted);
}

.kv strong {
    color: var(--text-main);
}

.feature-list {
    margin: 0;
    padding-left: 18px;
    color: var(--text-muted);
    line-height: 1.55;
}

.password-meter {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid #d3dfeb;
    background: #f8fbff;
}

.password-meter-track {
    width: 100%;
    height: 9px;
    border-radius: 999px;
    background: #d8e5f2;
    overflow: hidden;
}

.password-meter-fill {
    display: block;
    height: 100%;
    width: 0;
    background: #6091ba;
    transition: width 0.2s ease;
}

.password-meter-fill.is-danger {
    background: var(--warn);
}

.password-meter-label {
    margin: 8px 0 0;
    font-size: 13pt;
    color: var(--text-muted);
}

.password-meter-label.is-danger {
    color: var(--warn);
    font-weight: 700;
}

.password-checklist {
    margin: 10px 0 0;
    padding-left: 18px;
    color: var(--text-muted);
    font-size: 13pt;
    line-height: 1.5;
}

.password-checklist li {
    margin-bottom: 2px;
}

.password-checklist li.is-met {
    color: var(--ok);
}

.password-checklist li.is-failed {
    color: var(--warn);
    font-weight: 700;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.table th,
.table td {
    border: 1px solid #d8e4ef;
    padding: 10px 12px;
    text-align: left;
    font-size: 13pt;
}

.table th {
    background: #f3f8fd;
    color: var(--brand-dark);
}

.badge {
    display: inline-block;
    border: 1px solid #a8c2db;
    color: var(--brand-dark);
    background: #e8f1fb;
    padding: 3px 8px;
    font-size: 12pt;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: #fff;
}

.site-footer-inner {
    min-height: 56px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px 18px;
    font-size: 13pt;
    color: var(--text-muted);
}

@media (max-width: 900px) {
    .grid.two-cols {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    body.esa-body {
        background-size: auto 100vh;
        background-position: center top;
    }

    .container {
        width: calc(100% - 20px);
    }

    .brand span {
        font-size: 13pt;
    }

    .brand-strip-inner {
        justify-content: center;
        padding: 16px 0 12px;
    }

    .language-trigger {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    .language-list {
        grid-template-columns: 1fr;
    }

    .card-body {
        padding: 16px;
    }

    .card-title {
        font-size: 22px;
    }
}
