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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: url('../pattern_space.aFb4MW9l.svg') repeat, linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: 200px 200px, auto;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 580px;
}

.auth-card {
    background: #17181c;
    border-radius: 28px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
    width: 100%;
    min-height: 712px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    height: 240px;
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: "";
    display: block;
    border-radius: 568px;
    background: var(--background-surface-ground, #17181c);
    filter: blur(64px);
    height: 240px;
    position: absolute;
    opacity: .4;
    top: 0;
    width: 100%;
    z-index: 1;
}

.header::after {
    content: "";
    display: block;
    position: absolute;
    top: -181%;
    left: 0;
    width: 100%;
    flex-shrink: 0;
    aspect-ratio: 1/1;
    border-radius: 100%;
    background: conic-gradient(from 90deg at 50% 50%,#0cf 59.40000236034393deg,#0026ff 122.40000128746033deg,#a500c6 180deg,#0cf 241.2000060081482deg,#0026ff 298.7999939918518deg,#a500c6 360deg);
    filter: blur(44px);
    animation: svelte-vywflk-rotate 8s linear infinite;
    z-index: 1;
    opacity: 0.4;
}

@keyframes svelte-vywflk-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
    bottom: -78px;
}

.auth-logo {
    width: 38px;
    height: 38px;
    position: relative;
    display: inline-block;
    background: no-repeat center / contain var(--auth-logo);
    --auth-logo: url('../authLogo.CnGYimnD.png');
}

.svelte-1xyx93s {
    --icon-primary: white;
    filter: brightness(0) invert(1);
}

.auth-logo::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg,#fff0 15%,#ffffff4d,#fff0 55%);
    background-size: auto;
    background-size: 200% 100%;
    animation: svelte-1xyx93s-sweep 4s linear infinite;
    -webkit-mask: center / contain no-repeat var(--auth-logo);
    mask: center / contain no-repeat var(--auth-logo);
}

@keyframes svelte-1xyx93s-sweep {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

h3 {
    font-size: 16.5px;
    font-weight: 600;
    line-height: 20px;
    letter-spacing: .15px;
    color: white;
    padding: 9px 3px;
}

.step-subtitle {
    padding: 0px 3px 29px;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 20px;
    letter-spacing: .15px;
    color: #6d6e71;
    padding: 0px 9px 33px;
}

.form-container {
    width: 343px;
    display: flex;
    flex-direction: column;
    text-align: center;
    margin: auto;
    padding-bottom: 40px;
}

.form-step {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.form-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.form-step h2 {
    color: #fbfbfb;
    font-size: 22px;
    margin-bottom: 20px;
    text-align: center;
}

.code-info {
    color: #a0a0a0;
    font-size: 14px;
    margin-bottom: 10px;
    text-align: center;
}

.code-hint {
    color: #6d6e71;
    font-size: 12px;
    margin-bottom: 30px;
    text-align: center;
}

.code-input-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 25px;
}

.code-digit {
    width: 48px;
    height: 56px;
    border: 2px solid #545557;
    border-radius: 8px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    background: #2a2b2f;
    color: white;
    transition: all 0.3s ease;
}

.code-digit:focus {
    outline: none;
    border-color: white;
    background: #545557;
}

.code-digit.filled {
    border-color: #4ecdc4;
    background: #2a2b2f;
}

.code-digit.error {
    border-color: #dc3545;
    background: #2a2b2f;
    animation: shake 0.5s ease-in-out;
}

.input-group {
    position: relative;
    margin-bottom: 25px;
}

.phone-input-container {
    display: flex;
    align-items: center;
    border: 2px solid #545557;
    border-radius: 12px;
    background: #545557;
    transition: all 0.3s ease;
}

.phone-prefix {
    color: white;
    font-size: 16px;
    font-weight: 600;
    padding: 15px 0 15px 20px;
    user-select: none;
}

.input-group input {
    width: 100%;
    padding: 18px 20px 15px 10px;
    border: none;
    border-radius: 0 12px 12px 0;
    font-size: 19px;
    transition: all 0.3s ease;
    background: transparent;
    color: white;
    outline: none;
}

.input-group input::placeholder {
    color: #88898b;
    font-weight: 400;
}

.phone-input-container:focus-within {
    border-color: #6d6e71;
    box-shadow: 0 0 0 3px rgba(109, 110, 113, 0.2);
}

.input-hint {
    color: #545557;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: -.08px;
    padding: 5px 16px;
    text-align: left;
}

.btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.btn-primary {
    background: #545557;
    color: white;
    transition: all 0.3s ease;
}

.btn-primary:hover:not(:disabled):not(.disabled) {
    background: #6d6e71;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn-primary:active:not(:disabled):not(.disabled) {
    transform: translateY(0);
}

.btn-primary.disabled {
    background: #545557;
    color: #88898b;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.6;
}

.btn-primary.active, .btn-primary:not(.disabled):not(:disabled) {
    background: white;
    color: #17181c;
    font-weight: 600;
}

.btn-primary.active:hover, .btn-primary:not(.disabled):not(:disabled):hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

.btn-secondary {
    background: transparent;
    color: #a0a0a0;
    border: 2px solid #545557;
}

.btn-secondary:hover {
    background: #2a2b2f;
    border-color: #6d6e71;
    color: white;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.button-group .btn {
    margin-bottom: 0;
}

.error-message {
    background: #3a1f1f;
    color: #ff6b6b;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #dc3545;
    font-size: 14px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.status-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
}

.status-message.error {
    background: #3a1f1f;
    color: #ff6b6b;
    border-left: 4px solid #dc3545;
}

.status-message.success {
    background: #1f3a2f;
    color: #4ecdc4;
    border-left: 4px solid #4ecdc4;
}

.status-message.info {
    background: #1f2a3a;
    color: #66b3ff;
    border-left: 4px solid #66b3ff;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 40px;
    color: white;
    animation: bounce 0.6s ease-out;
}

@keyframes bounce {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.success-details {
    background: #2a2b2f;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    text-align: left;
}

.success-details p {
    color: #a0a0a0;
    margin-bottom: 10px;
    font-size: 14px;
}

.success-details strong {
    color: white;
}

#profile_info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #545557;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #545557;
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-text {
    color: #7d7d7d;
}

.sessions-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.session-item {
    background: #2a2b2f;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 2px solid #545557;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.session-item:hover {
    background: #545557;
    border-color: #6d6e71;
    transform: translateX(5px);
}

.session-item .filename {
    font-weight: 600;
    color: white;
    margin-bottom: 5px;
}

.session-item .details {
    font-size: 0.9em;
    color: #a0a0a0;
}

/* Скроллбар для темной темы */
.sessions-container::-webkit-scrollbar {
    width: 8px;
}

.sessions-container::-webkit-scrollbar-track {
    background: #2a2b2f;
    border-radius: 4px;
}

.sessions-container::-webkit-scrollbar-thumb {
    background: #545557;
    border-radius: 4px;
}

.sessions-container::-webkit-scrollbar-thumb:hover {
    background: #6d6e71;
}

/* Адаптивность */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    .auth-card {
        border-radius: 20px;
        min-height: auto;
    }
    
    .header {
        height: 200px;
        padding: 20px;
    }
    
    .logo-container {
        bottom: -60px;
    }
    
    .form-container {
        width: 100%;
        max-width: 343px;
        padding: 20px;
    }
    
    .form-step h2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 15px;
    }
    
    .code-digit {
        width: 42px;
        height: 50px;
        font-size: 20px;
    }
    
    .button-group {
        flex-direction: column;
    }
}

/* Анимации */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
