* {
    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);
}

.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;
}

.hack-banner {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    position: relative;
    font-size: 18px;
    font-weight: 800;
    text-align: center;
    letter-spacing: 0.2px;
    padding: 16px 20px 16px 54px;
    border-radius: 16px;
    margin-bottom: 14px;
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
    box-shadow: 0 16px 38px rgba(32, 56, 117, 0.24);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.hack-banner::before {
    position: absolute;
    left: 16px;
    top: 50%;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    transform: translateY(-50%);
    color: #ffffff;
    font-size: 18px;
    font-weight: 900;
    line-height: 26px;
    text-align: center;
}

.hack-banner.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.hack-banner--warning {
    background: linear-gradient(180deg, #fff8df 0%, #fff0b8 100%);
    color: #6b2500;
    border: 2px solid #ffb800;
    border-left: 8px solid #ff2d55;
    text-transform: uppercase;
}

.hack-banner--warning::before {
    content: "!";
    background: #ff2d55;
    box-shadow: 0 0 0 6px rgba(255, 45, 85, 0.12);
}

.hack-banner--warning.is-visible {
    animation: urgentBanner 1.05s ease-in-out infinite;
}

.hack-banner--warning span {
    color: #ff2d55;
    margin-right: 6px;
}

.hack-banner--success {
    background: #ffffff;
    color: #1f1f1f;
    border: 2px solid #005ff9;
    border-left: 8px solid #005ff9;
    margin-top: 14px;
    margin-bottom: 0;
}

.hack-banner--success::before {
    content: "✓";
    background: #005ff9;
    box-shadow: 0 0 0 6px rgba(0, 95, 249, 0.12);
}

.hack-banner--success.is-visible {
    animation: successBanner 0.95s ease both;
}

@keyframes urgentBanner {
    0%, 100% {
        box-shadow: 0 16px 38px rgba(32, 56, 117, 0.24), 0 0 0 0 rgba(255, 45, 85, 0.34);
    }
    50% {
        box-shadow: 0 18px 44px rgba(32, 56, 117, 0.3), 0 0 0 8px rgba(255, 45, 85, 0);
        transform: translateY(0) scale(1.015);
    }
}

@keyframes successBanner {
    0% {
        transform: translateY(10px) scale(0.96);
    }
    55% {
        transform: translateY(0) scale(1.025);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

#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;
}

#final-status {
    margin-top: 16px;
    color: #16ff7d;
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

#final-status.is-visible {
    opacity: 1;
    transform: translateY(0);
}

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

#joke.visible {
    opacity: 1;
}

/* Биометрия поверх чёрного экрана */
.bio-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 4, 12, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.bio-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.bio-overlay.is-hiding {
    opacity: 0;
}

.bio-card {
    width: min(340px, 92vw);
    text-align: center;
    padding: 28px 22px 24px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(12, 24, 42, 0.96) 0%, rgba(4, 10, 20, 0.98) 100%);
    border: 1px solid rgba(22, 255, 125, 0.28);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 40px rgba(22, 255, 125, 0.12);
    transform: translateY(16px) scale(0.94);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.bio-overlay.is-visible .bio-card {
    transform: translateY(0) scale(1);
}

.bio-scan {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bio-ring {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    border: 2px solid rgba(22, 255, 125, 0.25);
    opacity: 0;
}

.bio-overlay.is-scanning .bio-ring {
    animation: bioPulse 2s ease-out infinite;
}

.bio-ring-2 { animation-delay: 0.45s !important; inset: 0; }
.bio-ring-3 { animation-delay: 0.9s !important; inset: -8px; }

.bio-face {
    position: relative;
    z-index: 2;
    color: #16ff7d;
    filter: drop-shadow(0 0 10px rgba(22, 255, 125, 0.45));
}

.bio-overlay.is-scanning .bio-face {
    animation: bioGlow 1.2s ease-in-out infinite;
}

.bio-scanline-path {
    stroke: #7ef5c7;
    opacity: 0.9;
}

.bio-overlay.is-scanning .bio-scanline-path {
    animation: bioScanLine 1.1s ease-in-out infinite;
}

.bio-check {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #16ff7d;
    opacity: 0;
    transform: scale(0.6);
    z-index: 3;
}

.bio-overlay.is-success .bio-face {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.bio-overlay.is-success .bio-ring {
    animation: none;
    opacity: 0;
}

.bio-overlay.is-success .bio-check {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.bio-title {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #f4fff8;
    letter-spacing: 0.2px;
    margin-bottom: 6px;
}

.bio-sub {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 13px;
    color: rgba(126, 245, 199, 0.85);
}

@keyframes bioPulse {
    0% { opacity: 0.7; transform: scale(0.85); }
    100% { opacity: 0; transform: scale(1.25); }
}

@keyframes bioGlow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(22, 255, 125, 0.35)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 16px rgba(22, 255, 125, 0.7)); transform: scale(1.04); }
}

@keyframes bioScanLine {
    0% { transform: translateY(-14px); opacity: 0.15; }
    50% { opacity: 1; }
    100% { transform: translateY(14px); opacity: 0.15; }
}

/* Адаптив */

@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; /* как мобильная версия: правого блока нет */
    }
}

/* ======= MOBILE ADAPTATION ======= */
@media screen and (max-width: 600px) {

    .hack-wrapper {
        padding: 10px;
    }

    .hack-banner {
        font-size: 16px;
        padding: 14px 14px 14px 48px;
        border-radius: 14px;
    }

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

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