* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease-in-out;
}

.screen.active {
    opacity: 1;
    transform: translateX(0);
}

.screen.prev {
    transform: translateX(-100%);
}

/* Главный экран */
#welcome-screen {
    text-align: center;
}

.logo-container {
    margin-bottom: 60px;
}

.logo-circle {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.logo-text {
    font-size: 36px;
    font-weight: bold;
    color: white;
    letter-spacing: 2px;
}

.content {
    text-align: center;
    max-width: 320px;
    width: 100%;
}

.title {
    font-size: 28px;
    color: white;
    margin-bottom: 16px;
    line-height: 1.3;
    font-weight: 600;
}

.highlight {
    color: #FFD700;
    font-weight: 700;
}

.subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 40px;
    line-height: 1.4;
}

.login-button {
    background: #0088cc;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
}

.login-button:hover {
    background: #0077b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 136, 204, 0.4);
}

.login-button:active {
    transform: translateY(0);
}

.telegram-icon {
    width: 24px;
    height: 24px;
}

/* Экран загрузки */
.loading-container {
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 32px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-title {
    font-size: 24px;
    color: white;
    margin-bottom: 12px;
    font-weight: 600;
}

.loading-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
}

/* Экраны ввода */
.screen-title {
    font-size: 24px;
    color: white;
    margin-bottom: 12px;
    font-weight: 600;
    text-align: center;
}

.screen-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 32px;
    text-align: center;
    line-height: 1.4;
}

.code-input-container,
.input-container {
    margin-bottom: 24px;
}

.code-input,
.password-input {
    width: 100%;
    padding: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 18px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.code-input::placeholder,
.password-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.code-input:focus,
.password-input:focus {
    outline: none;
    border-color: #FFD700;
    background: rgba(255, 255, 255, 0.15);
}

.password-input {
    text-align: left;
}

.action-button {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: #FFD700;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.action-button:enabled:hover {
    background: #ffcc00;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 215, 0, 0.4);
}

.action-button:disabled {
    background: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.6);
    cursor: not-allowed;
    box-shadow: none;
}

.resend-button {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.resend-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

/* Экран успеха */
.success-icon {
    width: 80px;
    height: 80px;
    color: #4ade80;
    margin: 0 auto 32px;
}

.success-icon svg {
    width: 100%;
    height: 100%;
}

/* Экран ошибки */
.error-icon {
    width: 80px;
    height: 80px;
    color: #ef4444;
    margin: 0 auto 32px;
}

.error-icon svg {
    width: 100%;
    height: 100%;
}

/* Адаптивность */
@media (max-width: 375px) {
    .content {
        max-width: 280px;
    }
    
    .title {
        font-size: 24px;
    }
    
    .logo-circle {
        width: 100px;
        height: 100px;
    }
    
    .logo-text {
        font-size: 28px;
    }
}

/* Анимация появления элементов */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen.active .content {
    animation: fadeInUp 0.5s ease-out;
}

.screen.active .loading-container {
    animation: fadeInUp 0.5s ease-out;
}
