@font-face { font-family: 'SShvTerm Manrope'; src: url('../../fonts/sshvterm-manrope-400.ttf') format('truetype'); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: 'SShvTerm Manrope'; src: url('../../fonts/sshvterm-manrope-500.ttf') format('truetype'); font-style: normal; font-weight: 500; font-display: swap; }
@font-face { font-family: 'SShvTerm Manrope'; src: url('../../fonts/sshvterm-manrope-700.ttf') format('truetype'); font-style: normal; font-weight: 700; font-display: swap; }
@font-face { font-family: 'SShvTerm Manrope'; src: url('../../fonts/sshvterm-manrope-800.ttf') format('truetype'); font-style: normal; font-weight: 800; font-display: swap; }

body.sshvterm-auth {
    --auth-bg: #10151d;
    --auth-panel: #182131;
    --auth-ink: #f3f6fa;
    --auth-muted: #a3afbf;
    --auth-blue: #829dff;
    --auth-mint: #68e0aa;
    --auth-rule: #354258;
    --auth-error: #ffacac;
    min-height: 100vh;
    margin: 0;
    background: var(--auth-bg);
    color: var(--auth-ink);
    color-scheme: dark;
    font-family: 'SShvTerm Manrope', system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.55;
}

.sshvterm-auth *, .sshvterm-auth *::before, .sshvterm-auth *::after { box-sizing: border-box; }
.sshvterm-auth [hidden] { display: none !important; }
.sshvterm-auth a { color: var(--auth-blue); text-underline-offset: .2em; }
.sshvterm-auth a:hover { color: var(--auth-ink); }
.sshvterm-auth :is(a, button, input):focus-visible { outline: 3px solid var(--auth-blue); outline-offset: 3px; }
.auth-skip { position: absolute; left: 1rem; top: -8rem; z-index: 5; padding: .65rem 1rem; background: var(--auth-bg); }
.auth-skip:focus { top: .5rem; }

.auth-bar { border-bottom: 1px solid var(--auth-rule); }
.auth-bar-inner {
    width: min(100% - 2.5rem, 76rem);
    min-height: 4.5rem;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.auth-brand { display: flex; align-items: center; min-height: 44px; }
.auth-brand img { width: clamp(100px, 16vw, 143px); height: auto; }
.auth-nav { display: flex; align-items: center; gap: clamp(.8rem, 3vw, 2rem); }
.auth-nav > a, .auth-nav .site-lang-opt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    color: var(--auth-muted);
    font-size: .875rem;
    font-weight: 700;
    text-decoration: none;
}
.auth-nav > a:hover, .auth-nav .site-lang-opt:hover { text-decoration: underline; }
.auth-nav .site-lang { display: inline-flex; align-items: center; gap: 2px; }
.auth-nav .site-lang-opt { min-width: 37px; padding-inline: .4rem; border-radius: .35rem; }
.auth-nav .site-lang-opt[aria-current] { background: var(--auth-panel); color: var(--auth-ink); }
.auth-nav .site-flag svg { display: block; width: 21px; height: 15px; }

.auth-main { width: min(100% - 2.5rem, 66rem); margin: 0 auto; padding: clamp(2.5rem, 7.5vw, 7rem) 0 4rem; }
.auth-card {
    max-width: 35rem;
    margin-inline: auto;
    border: 1px solid var(--auth-rule);
    border-radius: 14px;
    background: var(--auth-panel);
    color: var(--auth-ink);
}
.auth-panel { padding: clamp(1.6rem, 3.7vw, 3.4rem); }
.auth-card--signup { display: grid; grid-template-columns: 1.03fr 1fr; max-width: none; }
.auth-context {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 0 0 .9rem;
    color: var(--auth-mint);
    font: 700 .72rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
    text-transform: uppercase;
    letter-spacing: .11em;
}
.auth-context::before { content: ''; width: 1.3rem; height: 2px; background: currentColor; }
.auth-title {
    margin: 0;
    color: var(--auth-ink);
    font: 800 clamp(2rem, 3.9vw, 3.4rem)/1.05 'SShvTerm Manrope', system-ui, sans-serif;
    letter-spacing: -.055em;
    overflow-wrap: break-word;
}
.auth-subtitle { margin: .85rem 0 1.65rem; color: var(--auth-muted); font-size: 1rem; }
.auth-form { display: grid; gap: 1.1rem; margin: 0; }
.auth-field { min-width: 0; }
.auth-field > label { display: block; margin: 0 0 .4rem; color: var(--auth-ink); font-size: .91rem; font-weight: 700; }
.auth-hint { margin: -.1rem 0 .55rem; color: var(--auth-muted); font-size: .86rem; }
.auth-input-wrap { position: relative; }
.auth-field .form-control {
    width: 100%;
    min-height: 48px;
    border: 1px solid #72819a;
    border-radius: .45rem;
    background: var(--auth-bg);
    color: var(--auth-ink);
    padding: .6rem .8rem;
    font: inherit;
}
.auth-field .form-control:focus { color: var(--auth-ink); background: var(--auth-bg); border-color: var(--auth-blue); box-shadow: none; }
.auth-field .form-control[aria-invalid] { border-color: var(--auth-error); }
.auth-input-wrap:has(.auth-reveal:not([hidden])) input { padding-right: 5.4rem; }
.auth-reveal {
    position: absolute;
    inset: 4px 4px 4px auto;
    padding-inline: .7rem;
    border: 0;
    border-radius: .32rem;
    background: var(--auth-bg);
    color: var(--auth-blue);
    font: 700 .8rem 'SShvTerm Manrope', system-ui, sans-serif;
}
.auth-reveal:hover { background: var(--auth-panel); }
.auth-error { color: var(--auth-error); margin: .45rem 0 0; font-size: .86rem; }
.auth-options { display: flex; align-items: center; justify-content: space-between; gap: .25rem 1rem; flex-wrap: wrap; font-size: .88rem; }
.auth-check { display: flex; align-items: center; gap: .5rem; min-height: 40px; cursor: pointer; }
.auth-check input { width: 17px; height: 17px; accent-color: var(--auth-blue); }
.sshvterm-auth .btn-auth {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 47px;
    width: 100%;
    padding: .65rem 1rem;
    background: var(--auth-blue);
    color: var(--auth-bg);
    border: 0;
    border-radius: .45rem;
    font: 800 .96rem/1.45 'SShvTerm Manrope', system-ui, sans-serif;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}
.sshvterm-auth .btn-auth:hover { background: #9fb3ff; color: var(--auth-bg); }
.auth-footer, .auth-secondary { margin: 1.3rem 0 0; font-size: .88rem; line-height: 1.6; }
.auth-footer { padding-top: 1.15rem; border-top: 1px solid var(--auth-rule); color: var(--auth-muted); }
.auth-footer a { display: inline-block; font-weight: 700; }
.auth-secondary { display: inline-block; }
.auth-guide {
    min-width: 0;
    padding: clamp(1.6rem, 3.7vw, 3.4rem);
    border-inline-start: 1px solid var(--auth-rule);
    border-radius: 0 14px 14px 0;
    background: #131c2a;
}
.auth-guide h2 { color: var(--auth-ink); font-size: clamp(1.25rem, 2.6vw, 1.75rem); font-weight: 700; line-height: 1.22; letter-spacing: -.035em; margin: 0 0 1.15rem; }
.auth-guide ul { list-style: none; margin: 0; padding: 0; }
.auth-guide li { margin: 0; padding: .8rem 0; border-top: 1px solid var(--auth-rule); }
.auth-guide strong, .auth-guide li span { display: block; }
.auth-guide strong { font-size: .95rem; margin-bottom: .2rem; }
.auth-guide li span, .auth-guide-note { color: var(--auth-muted); font-size: .88rem; line-height: 1.55; }
.auth-guide-note { margin: -.25rem 0 1rem; }
.auth-alert { padding: .8rem 1rem; border-left: 3px solid; background: var(--auth-bg); margin: 1.25rem 0; font-size: .94rem; }
.auth-alert p { margin: 0 0 .45rem; }
.auth-alert--error { border-color: var(--auth-error); }
.auth-alert--success { border-color: var(--auth-mint); }
.auth-hp { position: absolute; top: -9999px; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 760px) {
    .auth-main { width: min(100% - 2rem, 36rem); padding-top: 1.6rem; }
    .auth-card--signup { grid-template-columns: minmax(0, 1fr); }
    .auth-guide { border-inline-start: 0; border-top: 1px solid var(--auth-rule); border-radius: 0 0 14px 14px; }
    .auth-bar-inner { width: calc(100% - 2rem); min-height: 3.8rem; }
}
@media (max-width: 400px) {
    .auth-main { width: calc(100% - 1.5rem); }
    .auth-bar-inner { width: calc(100% - 1.5rem); gap: .5rem; }
    .auth-nav { gap: .45rem; }
    .auth-nav > a { font-size: .79rem; }
    .auth-panel, .auth-guide { padding: 1.35rem; }
}
