@font-face {
    font-family: 'TildaSans';
    src: url('fonts/TildaSans-VF.ttf') format('truetype-variations');
    font-weight: 100 900;
    font-style: normal;
    font-display: block;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

::selection {
    background-color: rgba(29, 110, 216, 0.4);
    color: #ffffff;
}

body, html {
    color-scheme: dark only !important;
    font-family: 'TildaSans', sans-serif;
    height: 100%;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overscroll-behavior: none;
    touch-action: none;
    display: flex;
    overflow: hidden;
    background-color: #000000;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
}

.split-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.split-right::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(29, 110, 216, 0.15) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(60px);
    z-index: 0;
    pointer-events: none;
    animation: pulseGlow 8s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

.split-left {
    flex: 1;
    background-color: #0E0E11;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.split-left::before, .split-left::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 15vh;
    z-index: 2;
    pointer-events: none;
}

.split-left::before {
    top: 0;
    background: linear-gradient(to bottom, #0E0E11 0%, transparent 100%);
}

.split-left::after {
    bottom: 0;
    background: linear-gradient(to top, #0E0E11 0%, transparent 100%);
}

.screen-gallery-wrap {
    position: absolute;
    width: 150vw;
    height: 150vh;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.screen-gallery-wrap.ready {
    opacity: 1;
}

.screen-gallery {
    display: flex;
    gap: 16px;
}

.col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 140px;
}

.col:nth-child(even) {
    margin-top: 160px;
    animation: marqueeDown 120s linear infinite;
}

.col:nth-child(odd) {
    animation: marqueeUp 120s linear infinite;
}

.item img {
    width: 100%;
    border-radius: 14px;
    display: block;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    background-color: #1a1b23;
    aspect-ratio: 9 / 19.5;
    object-fit: cover;
}

@keyframes marqueeUp {
    0% { transform: translateY(0); }
    100% { transform: translateY(calc(-50% + 70px)); }
}

@keyframes marqueeDown {
    0% { transform: translateY(calc(-50% - 8px)); }
    100% { transform: translateY(0); }
}

.fade-img {
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.fade-img.loaded {
    opacity: 1;
}

.auth-container {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.auth-main-block {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
}

.auth-title {
    font-size: 24px;
    font-weight: 400;
    color: #ffffff;
    margin-bottom: 24px;
    text-align: center;
}

.input-group {
    position: relative;
    margin-bottom: 16px;
    border-radius: 12px;
    background-color: #15161b;
    padding: 1px;
    overflow: hidden;
    z-index: 1;
    transition: box-shadow 0.2s ease;
    will-change: box-shadow;
}

.input-group::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    background: conic-gradient(from 0deg, #1d6ed8 0%, #081e3b 50%, #1d6ed8 100%);
    z-index: 0;
    animation: spinFocus 3s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
    will-change: transform;
}

@keyframes spinFocus {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.input-group:focus-within::before {
    opacity: 1;
}

.input-group:focus-within {
    box-shadow: 0 0 0 3px rgba(29, 110, 216, 0.2);
}

.auth-input {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 50px;
    padding: 20px 45px 4px 19px;
    background-color: #15161b;
    border: none;
    border-radius: 11px;
    outline: none;
    color: #ffffff;
    caret-color: #1d6ed8;
    transition: background-color 0.2s ease;
    font-size: 16px;
    font-family: inherit;
}

.auth-input:focus {
    background-color: #1a1b23;
}

input::-webkit-input-placeholder,
input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.4) !important;
    opacity: 1 !important;
}

input:-webkit-autofill::first-line {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 16px !important;
    color: #ffffff !important;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    border: none !important;
    -webkit-box-shadow: 0 0 0 1000px #15161b inset !important;
    -webkit-text-fill-color: #ffffff !important;
    border-radius: 11px !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

.floating-label {
    position: absolute;
    left: 20px;
    top: 17px;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: left top;
    background: linear-gradient(90deg, #A0B0BA 0%, #5A6B77 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    z-index: 2;
}

.auth-input:focus ~ .floating-label,
.auth-input:not(:placeholder-shown) ~ .floating-label {
    transform: translateY(-9px) scale(0.7);
}

.auth-input:not(:placeholder-shown) ~ .floating-label {
    color: rgba(255, 255, 255, 0.6);
}

.clear-btn {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s ease-out;
    z-index: 2;
    transform-origin: center;
}

.clear-btn.visible {
    opacity: 1;
    visibility: visible;
}

.email-check-wrapper {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #49a25e; /* цвет успеха, совпадает с btn-success */
    opacity: 0;
    visibility: hidden;
    z-index: 2;
    pointer-events: none;
}

.email-check-wrapper path {
    stroke-dasharray: 18;
    stroke-dashoffset: 18;
}

.email-check-wrapper.animate {
    opacity: 1;
    visibility: visible;
}

.email-check-wrapper.animate path {
    animation: drawEmailCheck 0.4s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

@keyframes drawEmailCheck {
    to { stroke-dashoffset: 0; }
}




.submit-btn {
    width: 100%;
    height: 52px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: linear-gradient(180deg, #2575e6 0%, #185cbc 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 4px 14px rgba(29, 110, 216, 0.2);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, background 0.2s ease;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .submit-btn:hover {
        background: linear-gradient(180deg, #2a7eed 0%, #1a64ca 100%);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 6px 20px rgba(29, 110, 216, 0.3);
    }
    .auth-input:hover:not(:focus), .otp-digit:hover:not(:focus) {
        background-color: #18191f;
    }
    .clear-btn:hover {
        color: rgba(255, 255, 255, 0.8);
        transform: translateY(-50%) scale(0.8);
    }
}

.submit-btn:active {
    transform: scale(0.99);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 2px 5px rgba(29, 110, 216, 0.1);
}

.hidden {
    display: none !important;
}

#otp-target {
    color: #ffffff;
    font-weight: 500;
}

.otp-inputs {
    height: 52px;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.otp-group {
    flex: 1;
    height: 100%;
    position: relative;
    background-color: #15161b;
    border-radius: 12px;
    padding: 1px;
    overflow: hidden;
    z-index: 1;
    transition: box-shadow 0.3s ease, background-color 0.2s ease;
}

.otp-group::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150px;
    height: 150px;
    background: conic-gradient(from 0deg, #1d6ed8 0%, #14488b 50%, #1d6ed8 100%);
    z-index: 0;
    animation: spinFocus 3s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
    will-change: transform;
}

.otp-group:focus-within::before {
    opacity: 1;
}

.otp-group:focus-within {
    box-shadow: 0 0 0 3px rgba(29, 110, 216, 0.2);
}

.otp-digit {
    width: 100%;
    height: 100%;
    min-width: 0;
    background-color: #15161b;
    border: none !important;
    border-radius: 11px;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    color: #ffffff;
    caret-color: transparent !important;
    position: relative;
    z-index: 1;
    transition: background-color 0.2s ease;
}

.otp-digit:focus {
    background-color: #1a1b23;
    outline: none;
    box-shadow: none !important;
}

.otp-group::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1px;          
    height: 24px;        
    background-color: #1d6ed8;
    /* box-shadow: 0 0 6px rgba(29, 110, 216, 0.5);  */
    border-radius: 2px;  
    opacity: 0;
    pointer-events: none;
    z-index: 2;          
}

.otp-group:focus-within:not(.filled)::after {
    animation: premiumCaret 1.5s ease-in-out infinite;
}

@keyframes premiumCaret {
    0%, 100% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scaleY(1); 
    }
    50% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scaleY(0.90); 
    }
}

.otp-group.filled {
    animation: popDigit 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-color: rgba(255, 255, 255, 0.2);
}

@keyframes popDigit {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.legal-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    margin-top: 16px;
    line-height: 1.4;
}

.legal-text a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
}

.timer-block {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.resend-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.resend-btn.fade-hidden {
    opacity: 0;
    pointer-events: none;
}

.resend-btn:disabled {
    color: rgba(255, 255, 255, 0.4);
    background: transparent;
    border-color: transparent;
    cursor: not-allowed;
}

.resend-btn.is-success {
    color: #ffffff !important;
}

#timer-text {
    font-variant-numeric: tabular-nums;
    min-width: 16px;
    text-align: center;
}

.timer-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
}

.timer-svg {
    width: 10px;
    height: 10px;
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 1;
}

.timer-progress {
    fill: none;
    stroke: rgba(255, 255, 255, 0.5);
    stroke-width: 1;
    stroke-dasharray: 28.3;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.check-svg {
    width: 14px;
    height: 12px;
    fill: none;
    stroke: #1d6ed8;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    margin-right: -2px;
}

.check-svg path {
    stroke-dasharray: 16;
    stroke-dashoffset: 16;
}

.check-svg.animate path {
    animation: drawCheck 0.4s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

.error-message {
    color: #d9534f;
    font-size: 13px;
    min-height: 18px;
    margin-top: -12px;
    margin-bottom: 4px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.error-message.visible {
    opacity: 1;
}

/* .input-error {
    animation: shake 0.5s ease-in-out both !important;
    box-shadow: 0 0 0 3px rgba(217, 83, 79, 0.4) !important;
} */
.input-error {
    animation: jellyShake 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) both !important;
    box-shadow: 0 0 0 3px rgba(217, 83, 79, 0.4) !important;
}
.input-error::before {
    background: #d9534f !important;
    opacity: 1 !important;
}

/* @keyframes shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(2px); }
    100% { transform: translateX(0); }
} */
@keyframes jellyShake {
    0%, 100% { 
        transform: translateX(0) scale(1); 
    }
    15% { 
        transform: translateX(-6px) scaleX(1.03) scaleY(0.97); 
    }
    30% { 
        transform: translateX(5px) scaleX(0.98) scaleY(1.02); 
    }
    45% { 
        transform: translateX(-4px) scaleX(1.01) scaleY(0.99); 
    }
    60% { 
        transform: translateX(2px) scaleX(0.99) scaleY(1.01); 
    }
    75% { 
        transform: translateX(-1px) scale(1); 
    }
}

.back-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 16px;
    width: 100%;
    transition: color 0.2s ease;
}

.back-btn:hover {
    color: #ffffff;
}

.step-footer {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

#step-request, #step-otp {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    max-width: 360px;
    align-self: start;
    display: flex;
    flex-direction: column;
}

#step-request {
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#step-request.step-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-30px);
}

#step-request.step-active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

#step-otp {
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#step-otp.step-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(30px);
}

#step-otp.step-active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.btn-loading, .btn-success {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.btn-success {
    background: #49a25e !important;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.otp-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    text-align: center;
}

.legal-text,
.otp-subtitle,
.timer-block,
.back-btn {
    margin: 0 !important;
}

.logo {
    position: absolute;
    top: 4vh;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100px;
    border-radius: 20px;
}

@media (min-width: 769px) {
    .logo {
        display: none;
    }
}

@media (max-width: 768px) {
    .split-left {
        display: none;
    }
    .split-right {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        overflow: hidden;
        padding: 18vh 20px 20px;
    }
    .auth-container {
        max-width: 100%;
    }
    .otp-group {
        width: 100%;
        max-width: 50px;
    }
    .otp-digit {
        width: 100%;
        max-width: 50px;
    }
    /* #step-request, #step-otp {
        transition: opacity 0.15s ease !important;
    }
    #step-request.step-hidden, #step-otp.step-hidden {
        transform: none !important;
    } */
}
@media (prefers-reduced-motion: reduce) {
    .input-group::before,
    .otp-group::before,
    .split-right::before,
    .col:nth-child(even),
    .col:nth-child(odd) {
        animation: none !important;
    }
    
    .input-error {
        animation: none !important;
    }
}

.otp-group:focus-within::before,
.otp-group.success-highlight::before {
    opacity: 1;
}

.otp-group:focus-within,
.otp-group.success-highlight {
    box-shadow: 0 0 0 3px rgba(29, 110, 216, 0.2);
}

.input-group, .otp-group {
    transition: box-shadow var(--anim-speed, 0.3s) ease, background-color 0.2s ease !important;
}
.input-group::before, .otp-group::before {
    transition: opacity var(--anim-speed, 0.3s) ease !important;
}

.hide-glow {
    box-shadow: none !important;
}
.hide-glow::before,
.hide-glow::after {
    opacity: 0 !important;
}







.steps-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
}
#footer-request, #footer-otp {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
#footer-request.step-hidden, #footer-otp.step-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(30px);
}
#footer-request.step-hidden { transform: translateX(-30px); }

#footer-request.step-active, #footer-otp.step-active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.text-morph {
    display: inline-block; /* Обязательно для transform */
    transition: filter 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

/* Старый текст разлетается на нас */
.text-morph.out {
    filter: blur(6px);
    opacity: 0;
    transform: scale(1.3);
}

/* Новый текст готовится появиться из глубины (мгновенно, без анимации) */
.text-morph.in {
    filter: blur(6px);
    opacity: 0;
    transform: scale(0.7);
    transition: none !important; 
}