:root {
    --card-bg-color: #212121;       
    --accent-glow-color: #198294;   
    --accent-green: #0DCCBD; 
}

* {
    margin: 0; 
    padding: 0; 
    box-sizing: border-box;
    font-family: 'Inter', sans-serif; 
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation; /* ЗАПРЕТ ДВОЙНОГО ТАПА И ЗУМА */
    -webkit-tap-highlight-color: transparent !important; /* Убирает синюю подсветку при клике */
}

*:focus {
    outline: none !important;
}

html, body {
    background-color: #000000;
    color: #ffffff;
    width: 100%; 
    margin: 0;
    padding: 0;
    display: block;
}

.prevent-select {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.allow-select {
    -webkit-user-select: text;
    -khtml-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.onboarding-screen {
    width: 100%; 
    min-height: 100dvh; 
    background-color: #000000; 
    z-index: 100000;
    display: flex; 
    flex-direction: column; 
    align-items: center;
    position: relative;
    overflow-x: hidden; 
    overflow-y: visible;
    transition: opacity 0.3s ease;
}

.glow-container {
    position: fixed; 
    top: 0; 
    left: 50%; 
    transform: translateX(-50%);
    width: 1800px; 
    height: 100vh; 
    pointer-events: none; 
    z-index: 1;
    background-image: 
        radial-gradient(ellipse 484px 244px at calc(50% - 323px) -7px, rgba(0, 217, 255, 1) 0%, rgba(0, 217, 255, 0) 100%),
        radial-gradient(ellipse 484px 244px at calc(50% + 323px) -7px, rgba(0, 255, 225, 1) 0%, rgba(0, 255, 225, 0) 100%);
    background-repeat: no-repeat;
}

.onboarding-wrapper {
    width: 100%; 
    max-width: 520px; 
    padding: 24px 24px 30px 24px;
    margin: 0 auto;
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between;
    z-index: 2; 
    position: relative;
    transition: padding 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.top-section, .onboarding-header, .onboarding-title, .onboarding-desc, .onboarding-footer {
    flex-shrink: 0 !important;
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.top-section {
    width: 100%; 
    display: flex; 
    flex-direction: column;
}

.header-nav {
    width: 100%; 
    display: flex; 
    align-items: center; 
    margin-bottom: 16px;
}

.back-btn {
    color: #ffffff; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    width: 32px; 
    height: 32px; 
    cursor: pointer;
}

.back-btn svg { 
    width: 24px; 
    height: 24px; 
}

.onboarding-header { 
    text-align: left; 
    width: 100%; 
}

.onboarding-title { 
    font-size: 32px; 
    font-weight: 700; 
    color: #ffffff; 
    margin-bottom: 6px; 
    letter-spacing: -0.02em; 
    line-height: 1.1;
}

.onboarding-desc { 
    font-size: 16px; 
    color: #b5b5b5; 
    font-weight: 400; 
    line-height: 1.35; 
}

#code-section { 
    margin-top: 35px; 
    width: 100%; 
}

.code-boxes-container {
    position: relative; 
    display: flex; 
    gap: 8px; 
    justify-content: space-between; 
    width: 100%;
}

.code-box {
    flex: 1; 
    height: 60px; 
    background-color: var(--card-bg-color); 
    border: none; 
    border-radius: 22px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 26px; 
    font-weight: 600; 
    color: #ffffff;
    position: relative; 
    overflow: hidden;
}

.hidden-code-input {
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    opacity: 0; 
    z-index: 10; 
    cursor: text; 
    color: transparent; 
    background: transparent; 
    border: none; 
    outline: none;
}

@keyframes caretBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.code-box.active::after {
    content: ''; 
    position: absolute; 
    width: 2px; 
    height: 26px;
    background-color: #ffffff; 
    animation: caretBlink 1s step-end infinite;
    border-radius: 2px;
}

@keyframes popIn {
    0% { transform: scale(0.6) translateY(5px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.code-val {
    display: inline-block; 
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.resend-text {
    text-align: left; 
    font-size: 14px; 
    color: #b5b5b5;
    margin-top: 16px; 
    cursor: pointer; 
    transition: color 0.2s;
}

.resend-text:hover:not(.disabled) { color: #ffffff; }
.resend-text.disabled { color: #555555; cursor: default; }

.onboarding-logo { 
    flex: 1; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    max-height: 300px;
    opacity: 1;
    overflow: hidden;
    transform: scale(1);
    transition: max-height 0.35s cubic-bezier(0.25, 0.8, 0.25, 1), 
                opacity 0.25s ease-out, 
                margin 0.35s cubic-bezier(0.25, 0.8, 0.25, 1),
                transform 0.35s ease-out;
}

.onboarding-logo img { 
    width: 180px; 
    height: auto; 
    object-fit: contain; 
}

body.keyboard-open .onboarding-logo {
    max-height: 0 !important;
    opacity: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    transform: scale(0.9);
    pointer-events: none;
    flex: 0 !important;
}

body.keyboard-open .onboarding-wrapper {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
}

.onboarding-footer { 
    width: 100%; 
    display: flex; 
    flex-direction: column; 
}

.step-container { 
    display: flex; 
    flex-direction: column; 
    transition: opacity 0.3s ease; 
}

.hidden { display: none !important; }

.input-container {
    display: flex; 
    align-items: center;
    background-color: var(--card-bg-color); 
    border: none;
    border-radius: 100px;
    height: 56px; 
    padding: 0 24px;
    margin-bottom: 24px;
}

.input-icon {
    width: 22px; 
    height: 22px; 
    color: #777777; 
    margin-right: 12px; 
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.input-icon.active { 
    color: var(--accent-green);
}

.invite-input {
    flex: 1; 
    background: transparent; 
    border: none;
    color: #ffffff; 
    font-size: 16px; 
    font-family: 'Inter', sans-serif;
    outline: none; 
    width: 100%; 
    transition: color 0.3s ease;
}

.invite-input::placeholder { color: #777777; }

.terms-wrapper { 
    display: flex; 
    align-items: flex-start; 
    gap: 12px; 
    cursor: pointer; 
    padding: 0 4px; 
    margin-bottom: 20px;
}

.terms-wrapper input[type="checkbox"] { display: none; }

.custom-checkbox {
    width: 24px; 
    height: 24px; 
    flex-shrink: 0; 
    background-color: var(--card-bg-color); 
    border-radius: 8px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: all 0.2s;
}

.custom-checkbox svg { 
    width: 14px; 
    height: 14px; 
    color: #000000; 
    opacity: 0; 
    transition: opacity 0.2s; 
}

.terms-wrapper input[type="checkbox"]:checked + .custom-checkbox { 
    background-color: #ffffff; 
}

.terms-wrapper input[type="checkbox"]:checked + .custom-checkbox svg { 
    opacity: 1; 
}

.terms-text { 
    font-size: 13px; 
    color: #b5b5b5; 
    line-height: 1.4; 
    margin-top: 3px;
}

.terms-text a { 
    color: var(--accent-green); 
    text-decoration: none; 
    font-weight: 500; 
}

.start-action-btn {
    width: 100%; 
    height: 56px; 
    background-color: #ffffff; 
    color: #000000;
    border: none; 
    border-radius: 100px; 
    font-size: 17px; 
    font-weight: 700;
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    transition: opacity 0.2s;
    outline: none !important;
}

.start-action-btn:disabled { 
    opacity: 0.4; 
    cursor: not-allowed; 
}

@media (max-height: 550px) {
    .onboarding-logo { 
        max-height: 0 !important; 
        opacity: 0 !important; 
        pointer-events: none; 
        flex: 0; 
    }
    .onboarding-desc { display: none; }
    .onboarding-wrapper { 
        padding-top: 24px; 
        padding-bottom: 20px; 
    }
}
