* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #e6f0ff;
    color: #1f1f1f;
}

/* Р­РєСЂР°РЅС‹ */

.screen {
    display: none;
    position: absolute;
    inset: 0;
    height: 100%;
    width: 100%;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.38s ease;
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* РљР°СЂС‚РѕС‡РєРё */

.card {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(32, 56, 117, 0.16);
}

/* Р­РєСЂР°РЅ 1 */

.card-loading {
    padding: 32px 24px;
    max-width: 520px;
    width: 100%;
    text-align: center;
    background: #ffffff;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
}

.logo span:first-child {
    color: #005ff9;
}

.logo span:last-child {
    color: #ff2d55;
}

.title-main {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.subtext {
    margin-top: 4px;
    font-size: 15px;
    color: #5c6470;
}

.dots {
    margin-top: 20px;
}

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 4px;
    border-radius: 50%;
    background: #d3d7e1;
    animation: blink 1.4s infinite ease-in-out;
}

.dot:nth-child(2) { animation-delay: .2s; }
.dot:nth-child(3) { animation-delay: .4s; }

@keyframes blink {
    0%, 80%, 100% { opacity: .3; }
    40% { opacity: 1; }
}

/* Р­РєСЂР°РЅ 2 вЂ” Р»РѕРіРёРЅ */

.page-login {
    max-width: 900px;
    width: 100%;
    display: flex;
    gap: 24px;
    align-items: stretch;
}

.login-card-wrap {
    flex: 3;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.card-login {
    padding: 32px 30px 24px;
    min-width: 360px;
}

.logo-login {
    margin-bottom: 16px;
}

.lang-row {
    font-size: 13px;
    color: #5c6470;
    margin-bottom: 18px;
}

.flag {
    font-size: 16px;
    margin-left: 6px;
}

.field-label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
}

.input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #d5d9e2;
    font-size: 14px;
    margin-bottom: 14px;
    outline: none;
    background: #fdfdff;
}

.input:focus {
    border-color: #005ff9;
    box-shadow: 0 0 0 1px rgba(0, 95, 249, 0.2);
}

.btn-primary {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: none;
    background: #005ff9;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin: 6px 0 10px;
}

.btn-primary:active {
    transform: translateY(1px);
}

/* Р­РєСЂР°РЅ РїСЂРѕРІРµСЂРєРё Р±РµР·РѕРїР°СЃРЅРѕСЃС‚Рё */

#screen-captcha {
    background: #ffffff;
    z-index: 10;
}

.captcha-card {
    width: min(100%, 420px);
    padding: 30px 26px 26px;
    text-align: center;
    border: 1px solid #e4e8ef;
    box-shadow: 0 14px 38px rgba(25, 45, 80, 0.12);
}

.captcha-shield {
    display: grid;
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    place-items: center;
    border-radius: 16px;
    background: #eaf2ff;
    color: #005ff9;
    font-size: 27px;
    font-weight: 800;
}

.captcha-title {
    margin-bottom: 7px;
    font-size: 22px;
    line-height: 1.2;
}

.captcha-subtitle {
    margin-bottom: 22px;
    color: #697386;
    font-size: 14px;
}

.captcha-box {
    display: flex;
    min-height: 78px;
    padding: 16px;
    align-items: center;
    gap: 13px;
    border: 1px solid #d4d9e2;
    border-radius: 10px;
    background: #fafbfd;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}

.captcha-box:hover {
    border-color: #9ebcf1;
}

.captcha-box input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.captcha-checkmark {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    border: 2px solid #8d96a5;
    border-radius: 5px;
    background: #fff;
}

.captcha-label {
    flex: 1;
    text-align: left;
    font-size: 16px;
    font-weight: 500;
}

.captcha-loader {
    display: none;
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    border: 3px solid #dce7f9;
    border-top-color: #005ff9;
    border-radius: 50%;
    animation: captcha-spin .7s linear infinite;
}

.captcha-box.checking .captcha-loader {
    display: block;
}

.captcha-box.verified {
    border-color: #54b77b;
    background: #f2fbf5;
    cursor: default;
}

.captcha-box.verified .captcha-checkmark {
    border-color: #1f9d55;
    background: #1f9d55;
}

.captcha-box.verified .captcha-checkmark::after {
    content: "вњ“";
    color: #fff;
    font-size: 19px;
    font-weight: 800;
}

.captcha-status {
    min-height: 20px;
    margin-top: 12px;
    color: #1f9d55;
    font-size: 13px;
}

@keyframes captcha-spin {
    to { transform: rotate(360deg); }
}

.link {
    font-size: 13px;
    color: #005ff9;
    text-decoration: none;
}

.restore-link {
    display: inline-block;
    margin-bottom: 6px;
}

.small-text {
    font-size: 13px;
    color: #7a8190;
}

.small-problem {
    text-align: center;
    margin: 6px 0 10px;
}

.alt-login {
    margin-top: 4px;
    display: flex;
    gap: 8px;
}

.alt-btn {
    flex: 1;
    border-radius: 8px;
    border: 1px solid #d5d9e2;
    padding: 8px 10px;
    background: #ffffff;
    font-size: 13px;
    cursor: pointer;
}

.alt-more {
    margin-top: 8px;
}

.register-link {
    display: block;
    margin-top: 14px;
    text-align: center;
}

/* РџСЂР°РІР°СЏ РїРѕРґСЃРєР°Р·РєР° */

.card-tip {
    flex: 2;
    padding: 18px 18px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    font-size: 14px;
    color: #3f4a5a;
    border-left: 4px solid #005ff9;
}

.tip-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.tip-icon {
    font-size: 22px;
}

.tip-title {
    font-weight: 600;
}

.tip-text {
    font-size: 13px;
    color: #5c6470;
}

/* Р­РєСЂР°РЅ 3 вЂ” РїСЃРµРІРґРѕ-РІР·Р»РѕРј */

.hack-wrapper {
    max-width: 960px;
    width: 100%;
    background: #020711;
    color: #16ff7d;
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(0,0,0,0.6);
    padding: 16px;
    font-family: "SF Mono", "Fira Code", monospace;
}

#hack-header {
    font-size: 13px;
    color: #7ef5c7;
    margin-bottom: 10px;
}

#code-area {
    height: 360px;
    overflow-y: auto;
    background: #000309;
    border-radius: 8px;
    padding: 12px;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
}

#joke {
    margin-top: 12px;
    font-size: 13px;
    color: #fefefe;
    text-align: right;
    opacity: 0;
    transition: opacity 0.4s ease;
}

#joke.visible {
    opacity: 1;
}

/* Р­РєСЂР°РЅ 4 вЂ” Р±РµР·РѕРїР°СЃРЅР°СЏ РїСЃРµРІРґРѕР±РёРѕРјРµС‚СЂРёСЏ */

/* Экран 4 — безопасная псевдобиометрия */

.biometric-screen {
    background:
        radial-gradient(
            circle at 50% 20%,
            rgba(0, 95, 249, 0.12),
            transparent 42%
        ),
        #e6f0ff;
}

.biometric-panel {
    width: min(100%, 440px);
    padding: 32px 28px 28px;
    border: 1px solid #dbe4f0;
    border-radius: 22px;
    background: #ffffff;
    box-shadow:
        0 18px 45px
        rgba(32, 56, 117, 0.16);
    color: #172135;
    text-align: center;
}

.biometric-demo-label {
    display: inline-flex;
    margin-bottom: 18px;
    padding: 6px 11px;
    border: 1px solid #bed5f8;
    border-radius: 999px;
    background: #eaf2ff;
    color: #005ff9;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.13em;
}

.biometric-stage {
    position: relative;
    display: grid;
    width: 164px;
    height: 164px;
    margin: 0 auto 22px;
    place-items: center;
    overflow: hidden;
    border: 1px solid #cbdcf4;
    border-radius: 34px;
    background:
        linear-gradient(
            145deg,
            #eef6ff,
            #dcecff
        );
    box-shadow:
        inset 0 0 24px
        rgba(0, 95, 249, 0.08);
}

.face-outline {
    position: relative;
    width: 88px;
    height: 110px;
    border: 3px solid #2486f6;
    border-radius: 44px 44px 38px 38px;
    box-shadow:
        0 0 22px
        rgba(36, 134, 246, 0.25);
    transition: opacity 0.3s ease;
}

.face-eye {
    position: absolute;
    top: 42px;
    width: 9px;
    height: 6px;
    border-radius: 50%;
    background: #2486f6;
}

.face-eye-left {
    left: 22px;
}

.face-eye-right {
    right: 22px;
}

.face-mouth {
    position: absolute;
    left: 50%;
    bottom: 24px;
    width: 26px;
    height: 10px;
    border-bottom: 2px solid #2486f6;
    border-radius: 50%;
    transform: translateX(-50%);
}

.scan-line {
    position: absolute;
    left: -36px;
    top: 0;
    width: 154px;
    height: 2px;
    background: #18b978;
    box-shadow:
        0 0 12px 4px
        rgba(24, 185, 120, 0.35);
    animation:
        face-scan
        1.1s
        ease-in-out
        infinite alternate;
}

.biometric-success {
    position: absolute;
    display: grid;
    width: 74px;
    height: 74px;
    place-items: center;
    border-radius: 50%;
    background: #1caa67;
    box-shadow:
        0 0 28px
        rgba(28, 170, 103, 0.32);
    color: #ffffff;
    font-size: 42px;
    font-weight: 800;
    opacity: 0;
    transform: scale(0.65);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

.biometric-title {
    margin-bottom: 10px;
    color: #172135;
    font-size: 23px;
    line-height: 1.25;
}

.biometric-note {
    min-height: 42px;
    color: #697386;
    font-size: 14px;
    line-height: 1.5;
}

.biometric-progress {
    height: 9px;
    margin-top: 22px;
    overflow: hidden;
    border-radius: 999px;
    background: #dfe8f3;
}

.biometric-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background:
        linear-gradient(
            90deg,
            #238aff,
            #32c890
        );
    box-shadow:
        0 0 12px
        rgba(35, 138, 255, 0.25);
    transition: width 0.13s linear;
}

.biometric-percent {
    margin-top: 9px;
    color: #238aff;
    font-family:
        "SF Mono",
        "Fira Code",
        Consolas,
        monospace;
    font-size: 13px;
    font-weight: 600;
}

.biometric-panel.completed
.face-outline,

.biometric-panel.completed
.scan-line {
    opacity: 0;
}

.biometric-panel.completed
.biometric-success {
    opacity: 1;
    transform: scale(1);
}

.biometric-panel.completed
.biometric-progress span {
    background: #1caa67;
}

.biometric-panel.completed
.biometric-percent {
    color: #159455;
}

@keyframes face-scan {
    from {
        transform: translateY(12px);
    }

    to {
        transform: translateY(94px);
    }
}

/* РђРґР°РїС‚РёРІ */

@media (max-width: 900px) {
    .page-login {
        flex-direction: column;
        max-width: 420px;
    }

    .card-tip {
        border-left: none;
        border-top: 4px solid #005ff9;
        margin-top: 10px;
    }
}

@media (max-width: 768px) {
    .card-login {
        padding: 24px 20px 20px;
        min-width: auto;
    }

    .card-tip {
        display: none; /* РєР°Рє РјРѕР±РёР»СЊРЅР°СЏ РІРµСЂСЃРёСЏ: РїСЂР°РІРѕРіРѕ Р±Р»РѕРєР° РЅРµС‚ */
    }
}

.support-block {
    display: none;
    width: 100%;
    max-width: 600px;
    margin: 40px auto 0 auto;
    padding: 18px 22px;
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(6px);
    border-radius: 12px;
    text-align: center;
    font-size: 18px;
    color: #222;
    line-height: 1.5;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.support-block.visible {
    display: block;
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 50;
    margin: 0;
    transform: translateX(-50%);
}

.support-block a {
    color: #0a68ff;
    font-weight: 600;
    text-decoration: none;
}
.support-block a:hover {
    text-decoration: underline;
}
/* ======= MOBILE ADAPTATION ======= */
@media screen and (max-width: 600px) {

    .captcha-card {
        padding: 24px 18px 20px;
    }

    .captcha-box {
        min-height: 72px;
        padding: 14px;
    }

    .support-block {
        max-width: 90%;
        margin: 20px auto 10px auto;
        padding: 14px 16px;
        font-size: 15px;
        line-height: 1.4;
        border-radius: 10px;
    }

    .support-block a {
        font-size: 16px;
    }

    .hack-wrapper {
        padding: 10px;
    }

    #code-area {
        font-size: 13px;
        line-height: 1.3;
        padding: 12px;
    }

    .biometric-panel {
        padding: 25px 18px 23px;
    }

    .biometric-stage {
        width: 148px;
        height: 148px;
    }

    .biometric-title {
        font-size: 20px;
    }

    .terminal-container img,
    .terminal-container {
        max-width: 100%;
        margin: 0 auto;
        border-radius: 10px !important;
    }
}

/* Крупный текст терминала после биометрии */

#code-area .hack-intro-line {
    color: #7ef5c7;
    font-size: 17px;
    line-height: 1.7;
    font-weight: 600;
}

#code-area .hack-space-line {
    height: 16px;
}

#code-area .hack-document-line {
    margin-bottom: 5px;
    color: #16ff7d;
    font-size: 21px;
    line-height: 1.65;
    font-weight: 700;
}

#code-area .hack-finish-line {
    margin-top: 14px;
    color: #ffffff;
    font-size: 23px;
    line-height: 1.5;
    font-weight: 800;
    text-shadow:
        0 0 12px
        rgba(22, 255, 125, 0.65);
}

@media screen and (max-width: 600px) {
    #code-area .hack-intro-line {
        font-size: 15px;
    }

    #code-area .hack-document-line {
        font-size: 17px;
        line-height: 1.55;
    }

    #code-area .hack-finish-line {
        font-size: 18px;
    }
}

/* Принудительно скрываем контактный блок */

body .support-block {
    display: none !important;
}

body .support-block.visible {
    display: block !important;
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 50;
    margin: 0;
    transform: translateX(-50%);
}